const script = {
id: "a-script",
js: ["script.js"],
matches: ["https://example.com/*"],
};
try {
await browser.scripting.registerContentScripts([script]);
} catch (err) {
console.error(`failed to register content scripts: ${err}`);
}scripting.registerContentScripts() / notebook
scripting.registerContentScripts()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.