-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
In Firefox, the following code works:
browser.tabs.insertCSS({ file: '/popup/css/insert.css' });
// ...after, when Reset is clicked:
browser.tabs.removeCSS({ file: '/popup/css/insert.css' });However, Chrome doesn't support .removeCSS() until version 87 (at the time of writing, still in beta).
So in Chrome I can't just remove the previously inserted CSS as I do in Firefox 🤷♂️.
Probable solution
To change the way the css is inserted: Instead of using the browser.tabs API, insert it in the html as a node.
That way it's possible to remove it later.
But this feels too complicated for what it is, plus the .removeCSS() already works on Firefox.
Current solution
So for now, the solution is to just reload the tab 🤷♂️.
- browser.tabs.removeCSS({ file: '/popup/css/insert.css' });
+ browser.tabs.reload();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels