I am trying to create an addon with the new addons builder preview (https://builder.addons.mozilla.org/), and I need a function to run about once every 10 minutes. I have tr
Use nsITimer
: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsITimer
It doesn't require you to use the unnecessary Jetpack SDK, and the extra require
function; you can use Components.classes
like you do for other XPCOM interaction within Mozilla addons.
Use the timer module:
var tmr = require('timer');
tmr.setInterval(timedCount, 10000); // no need for an anon function since you don't pass any arguments to your function nor capture anything in a closure
please note that the above is deprecated
var tmr = require('sdk/timers');
is now used instead