Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox "suspends" UI/DOM updates when its window is in the background or loses focus?

  • No replies
  • 1 has this problem
  • 1 view
more options

I'm working to support a user who uses Firefox 79 on macOS 10.15.

Throughout the day, this user has to run a long-running Python script that uses the selenium module and geckodriver to have Firefox automatically interact with some ancient web based accounting software.

This approach is out of my control, I did not implement it, and being a very small company, there's no budget to change it or buy new hardware. It is what it is.

We also can't run in any sort of a headless mode, as the user must sometimes manually interact with this ancient accounting web site in rare cases.

The script itself works fine, as long as Firefox's window retains focus or stays in the foreground the whole time. It can run successfully for days like this.

The problem happens when Firefox ends up becoming a background window while the Selenium script is still running.

This happens often, as the user usually also has other stuff that needs to be done on this computer.

When in the background, Firefox and the Selenium script will work fine for some time. But then it's like Firefox suspends itself.

The Selenium script can still communicate with Firefox, but it's like Firefox has stopped updating the UI or the DOM for some reason.

This can cause the Selenium script to fail, as it can't find elements that it expects to be present in the DOM.

If the Firefox window is brought to the foreground again, it shows an outdated page rendering and the cursor is a "+" cross shape. Clicking within the Firefox window, for example, seems to refresh the UI, and it'll show the correct, current page after a few seconds.

Does Firefox do something to suspend tabs or windows that no longer have focus or are no longer in the foreground?

If it does, is there some way to easily disable this?

I can understand something like that being useful to save energy on laptops, for example, but in our case it's destroying Firefox's usability for this long-running Selenium job.

Many thanks!

I'm working to support a user who uses Firefox 79 on macOS 10.15. Throughout the day, this user has to run a long-running Python script that uses the selenium module and geckodriver to have Firefox automatically interact with some ancient web based accounting software. This approach is out of my control, I did not implement it, and being a very small company, there's no budget to change it or buy new hardware. It is what it is. We also can't run in any sort of a headless mode, as the user must sometimes manually interact with this ancient accounting web site in rare cases. The script itself works fine, as long as Firefox's window retains focus or stays in the foreground the whole time. It can run successfully for days like this. The problem happens when Firefox ends up becoming a background window while the Selenium script is still running. This happens often, as the user usually also has other stuff that needs to be done on this computer. When in the background, Firefox and the Selenium script will work fine for some time. But then it's like Firefox suspends itself. The Selenium script can still communicate with Firefox, but it's like Firefox has stopped updating the UI or the DOM for some reason. This can cause the Selenium script to fail, as it can't find elements that it expects to be present in the DOM. If the Firefox window is brought to the foreground again, it shows an outdated page rendering and the cursor is a "+" cross shape. Clicking within the Firefox window, for example, seems to refresh the UI, and it'll show the correct, current page after a few seconds. Does Firefox do something to suspend tabs or windows that no longer have focus or are no longer in the foreground? If it does, is there some way to easily disable this? I can understand something like that being useful to save energy on laptops, for example, but in our case it's destroying Firefox's usability for this long-running Selenium job. Many thanks!