Skip to content

Commit 06c18ec

Browse files
committed
refactor: run in isolated world
1 parent 414063f commit 06c18ec

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

src/entrypoints/play-all-injection/index.ts src/entrypoints/content/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { defineUnlistedScript } from "wxt/sandbox";
1+
import { defineContentScript } from "wxt/sandbox";
22

33
import Page from "./page";
44

5-
export default defineUnlistedScript(main);
5+
export default defineContentScript({
6+
matches: ["https://www.youtube.com/*"],
7+
runAt: "document_end",
8+
main,
9+
});
610

711
function main() {
812
Page.applyStyleForPlayAllButton();
File renamed without changes.

src/entrypoints/play-all.content.ts

-12
This file was deleted.

wxt.config.ts

-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ export default defineConfig({
88
extensionApi: "chrome",
99
manifest: ({ browser }) => ({
1010
name: "Youtube Play All",
11-
web_accessible_resources: [
12-
{
13-
resources: ["play-all-injection.js"],
14-
matches: ["https://www.youtube.com/*"],
15-
},
16-
],
1711
}),
1812
zip: {
1913
artifactTemplate: "{{browser}}.zip",

0 commit comments

Comments
 (0)