I know that it's possible to add CSS to a page with Content_Scripts, but I want to use the InsertCSS function in a JS file.
I have:
chrome.tabs.insertCSS(null, {code: "adfree.css"});
But it doesn't change anything of a webpage. I gave the permissions:
"permissions": [
"tabs", "*://*"
],
Why doesn't it work?
Edit:
chrome.tabs.insertCSS({file: "adfree.css"});
or
chrome.tabs.insertCSS(null, {file: "adfree.css"});
doesn't work also...
You are passing it a file name, but using the code key, when you should be using the file key:
chrome.tabs.insertCSS(null, {file: "adfree.css"});
See the documentation for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With