I have an extension working almost well, except one point. I have a background script that fires an alarm every ten minutes. The alarm updates a value on the icone in the menu bar. This works fine.
However a click on this icon, loads a popup, it also works fine.
But from there, the alarm from my background script is no more fired.
I guess it has something to see with persistent scripts not allowed in firefox (it works well in chrome), but how can I make it works ?
Thanks for your answer.
The alarm is repeating, here is the code to create it : browser.alarms.create("updateFavVisits", {delayInMinutes: 0.1, periodInMinutes: 10} );
And here is how I catch it : browser.alarms.onAlarm.addListener(function( alarm ) { setIconValue(); });
Both alarms and listener are in a background.js file called via the manifest.json :
“background”: {
“scripts” : [“dist/js/jquery.js”, “dist/js/background.js”]
}
Are you sure the alarm is no longer fired? Could it be that it is fired but the icon is no longer updated? Have you checked the Browser Console for any errors?
Having a file to test would be useful to try to find the problem.