Hello! I am making my own adblock-based Firefox Extension to block ads. And I have a problem, I use manifest 2, ads are blocked, but the changes are applied only after the Extension is restarted, which should not be the case. Maybe there are some specific settings that I have not found, because for example on Opera and Chrome the Extension works perfectly and the changes in the blocking rules are applied immediately without any application restarts.Thanks for your help
Knowing nothing about your code or how your extension is working, my immediate guess is that you are storing the block settings on cache in the background script.
In Manifest V3, service workers are not persistent, so the settings are probably reloading each time you go to a new website.
In Manifest V2, background scripts are persistent, so they are only run once when the add-on starts. This means you would need to listen for changes to the settings (probably using the Storage API) or load your settings when they are needed.
My extension is built on the open source Adblock using the EWE library. AdBlock doesn’t have this problem and there’s also manifest 2. When I looked at the AdBlock code, I couldn’t find any place where they listen for changes and then load them. But thanks for the answer! I’ll try a few more options
Thanks for the recommendation! I did everything through the control using browser.storage.local and everything works)