Home » Android » android – FireFox addon script slowing down when tab is changed – how to fix?-Exceptionshub

android – FireFox addon script slowing down when tab is changed – how to fix?-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I am working on a firefox addon. Everything works well when I am on the tab on which the add-on content script is running. But as soon as I switch tab, the content script slows down.

A similar problem is reported in the following questions

  1. How can I make setInterval also work when a tab is inactive in Chrome?
  2. Chrome: timeouts/interval suspended in background tabs?
  3. How to prevent chrome extension content script pausing when switching tab

I tried using a webworker as explained in the answer. However, webworked API doesn’t seem to work for add-ons.

Following pages indicate that web-worker is not supported for firefox addon
https://developer.mozilla.org/en-US/docs/Mozilla/Gecko/Chrome/API/ChromeWorker
https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/High-Level_APIs/page-worker

Is there any reliable way to make setInterval work in content-script when the tab is not active?

How to&Answers:

go to Options->Home->Firefox Home Content-> take it webSearch and TopSite .These help speed firefox
enter image description here

enter image description here