I wrote below code in src/pages/background/index.ts
trying to get content_script
chrome.scripting.registerContentScripts([
{
js: ["src/pages/content/index.tsx"],
matches: ["*://*/*", "<all_urls>"],
runAt: "document_idle",
id: "session-script",
},
])
.then(() => console.log("registration complete"))
.catch((err) => console.warn("unexpected error", err));
This is the error I got when inspecting service_worker
Do you know how to resolve it? My purpose is to have content_script to access window object of the active page.