Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda