Is there any way to disable/enable a CSS content script from a browserAction
or pageAction
icon? I'm talking about the kind of script that runs a CSS content script, as defined in the manifest, on a specific set of matched pages. So, if the manifest includes:
"content_scripts": [
{
"matches": [ "*://*.somewhere.com/*" ],
"css": ["somewhere.css"]
}
]
which would inject somewhere.css
on somewhere.com
. Is there any way to write a browserAction
or pageAction
options popup that could fully enable or disable the CSS content script?
I know that I could write a JavaScript content script that listens to such an options popup and then adds/subtracts CSS rules and/or classes to the page. But I want this CSS inserted before the page is rendered and as far as I can tell the only way to do that is with a CSS content script.
But, is there a way to fully enable or disable the extension—which only has a CSS content script—from the popup? I can't see a way to do this.