Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
In Firefox what happens to websockets when the window is minimized or focussed on another tab?

I develop a web-app which employs the use of a websocket to deliver constant real-time data, about twice a second. On each 'data' callback, certain elements on the page have to be re-built to reflect the changes delivered by the websocket.

A user has complained of some strange behaviour in Firefox, whereby if they deactivate the webpage (minimize browser or focus on another tab), and return to it 30 minutes later, every 'data' callback since deactivating appears to run in sequence upon reactivating the page, and the user can see the page updating with each payload over the course of several seconds like it's fast-forwarding through the events of the last 30 minutes. Unfortunately I cannot recreate this on my end with my version of Firefox so I can't debug it further.

I would expect the websocket 'data' callbacks to continue running in the background, as it appears to in Chrome, but this particular version of Firefox appears to work slightly differently.

To fix the issue, I need to understand how Firefox handles events and interval callbacks when the page is deactivated. Do the websocket events get buffered? If I were to print the date + time on each 'data' callback, would I see the Date of receiving the event or the date of execution upon reactivation?

And does setInterval also behave similarly? (ie, if I run setInterval(()=>console.log(new Date()),1000) and deactivated for 30 seconds, on reactivating do I see 30 logs with the date now, or dates incrementing from 30 seconds ago to now)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!