diff --git a/docs/guide/essentials/content-scripts.md b/docs/guide/essentials/content-scripts.md index b9777af3..3c0c77a9 100644 --- a/docs/guide/essentials/content-scripts.md +++ b/docs/guide/essentials/content-scripts.md @@ -211,9 +211,7 @@ export default defineContentScript({ anchor: 'body', onMount: (container) => { // Create the Svelte app inside the UI container - mount(App, { - target: container, - }); + return mount(App, { target: container }); }, onRemove: (app) => { // Destroy the app when the UI is removed @@ -396,11 +394,9 @@ export default defineContentScript({ anchor: 'body', onMount: (container) => { // Create the Svelte app inside the UI container - mount(App, { - target: container, - }); + return mount(App, { target: container }); }, - onRemove: () => { + onRemove: (app) => { // Destroy the app when the UI is removed unmount(app); },