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

前端 未结 3 1075
南方客
南方客 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:06

    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.

提交回复
热议问题