How can I add a recurring timer to a Firefox addon?

前端 未结 3 1088
南方客
南方客 2021-01-06 05:37

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

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 06:12

    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
    

提交回复
热议问题