I have a Chrome extension that should apply custom CSS rules to the matched website. I want to make small adjustments to the CSS that gets applied based on options set in the extension options via the default_popup
html file.
I can't use a CSS content script because that can't be programmatically controlled. It's all or nothing.
So what I want is for my Javascript content script to read the saved options from chrome.storage.sync
and then inject the appropriate CSS files based on the just read options.
However, to use injectCSS()
requires access to chrome.tabs
--- yet chrome.tabs
cannot be used in a content script!
This must be a common thing. Suggestions on how to accomplish this using the Chrome extension APIs?