Error on loading content script

No description
2 Replies
Arcane
Arcane2y ago
@tbhaxor.com has reached level 1. GG!
ĐARK々MÁTTER
ĐARK々MÁTTEROP2y ago
This is what I used
<script context="module" lang="ts">
import type {
PlasmoCSConfig,
PlasmoGetInlineAnchor,
PlasmoMountShadowHost
} from "plasmo"

export const config: PlasmoCSConfig = {
matches: ["https://*.google.com/*"]
}

export const getInlineAnchor: PlasmoGetInlineAnchor = () => document.querySelector("body")

export const mountShadowHost: PlasmoMountShadowHost = ({
anchor, shadowHost
}) => {
console.log(anchor, shadowHost)
anchor!.element!.insertBefore(shadowHost!, anchor!.element!.firstChild)
}
</script>

<script>
let count = 0
let increment = () => count++
</script>

<div style="text-align: center; font-size: x-large;">
<span style="color: red;">{count}</span>
<button on:click={increment}>A lie is a very poor way to say hello</button>
</div>
<script context="module" lang="ts">
import type {
PlasmoCSConfig,
PlasmoGetInlineAnchor,
PlasmoMountShadowHost
} from "plasmo"

export const config: PlasmoCSConfig = {
matches: ["https://*.google.com/*"]
}

export const getInlineAnchor: PlasmoGetInlineAnchor = () => document.querySelector("body")

export const mountShadowHost: PlasmoMountShadowHost = ({
anchor, shadowHost
}) => {
console.log(anchor, shadowHost)
anchor!.element!.insertBefore(shadowHost!, anchor!.element!.firstChild)
}
</script>

<script>
let count = 0
let increment = () => count++
</script>

<div style="text-align: center; font-size: x-large;">
<span style="color: red;">{count}</span>
<button on:click={increment}>A lie is a very poor way to say hello</button>
</div>
Want results from more Discord servers?
Add your server