We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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).
.removeCSS()
So in Chrome I can't just remove the previously inserted CSS as I do in Firefox 🤷♂️.
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.
So for now, the solution is to just reload the tab 🤷♂️.
- browser.tabs.removeCSS({ file: '/popup/css/insert.css' }); + browser.tabs.reload();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In Firefox, the following code works:
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 🤷♂️.
The text was updated successfully, but these errors were encountered: