ĐARK々MÁTTER
ĐARK々MÁTTER
PD🧩 Plasmo Developers
Created by ĐARK々MÁTTER on 11/13/2024 in #👟framework
Svelte popup is not working from the with-svelte example
It works now, the problem was with svelte config.
import preprocess from "svelte-preprocess"

/**
* This will add autocompletion if you're working with SvelteKit
* https://github.com/sveltejs/svelte-preprocess/blob/main/docs/usage.md
* @type {import('@sveltejs/kit').Config}
*/
const config = {
preprocess: preprocess({
// ...svelte-preprocess options
}),
compilerOptions: {
css: "injected" // this is the default mode
}
// ...other svelte options
}

export default config
import preprocess from "svelte-preprocess"

/**
* This will add autocompletion if you're working with SvelteKit
* https://github.com/sveltejs/svelte-preprocess/blob/main/docs/usage.md
* @type {import('@sveltejs/kit').Config}
*/
const config = {
preprocess: preprocess({
// ...svelte-preprocess options
}),
compilerOptions: {
css: "injected" // this is the default mode
}
// ...other svelte options
}

export default config
3 replies
PD🧩 Plasmo Developers
Created by ĐARK々MÁTTER on 7/12/2023 in #👟framework
Error on loading content script
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>
4 replies
PD🧩 Plasmo Developers
Created by ĐARK々MÁTTER on 7/11/2023 in #👟framework
How can load multiple JS in the content script file
Can anyone help me here?
4 replies
PD🧩 Plasmo Developers
Created by ĐARK々MÁTTER on 7/11/2023 in #👟framework
How can load multiple JS in the content script file
Ok
4 replies