nt1m / vivaldi-fox

An add-on that aims to add Vivaldi style toolbar colouring to the Firefox UI
https://addons.mozilla.org/en-US/firefox/addon/vivaldifox/
203 stars 22 forks source link

Fix <all_urls> permission being an optional and required permission #126

Closed 7ritn closed 1 year ago

7ritn commented 2 years ago

Hi, I noticed that now the permission is optional, but also required, because the content_scripts property in the manifest requires it to insert the content script into every page. This pull request registers and unregisters the content script depending on the optional permission.

I need to save the contentScriptObject in the state of the addon, so I can unregister the content script, when the option is disabled. You could also simplify the code, by just letting the content script stay registered until the browser is relaunched, but I believe that this is the proper way to do it.