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

157
Visualizações
Window properties becomes undefined

This is a very general question. Sadly I cannot provide you with any code sample that could help to shed some light on this particular issue.

I have quite a complex script that works with window objects (main window or window from iframes). I store them to variables and work with them later.

This script has an error logging mechanism. It tries to catch all possible errors (unhandledrejection and error events) and sends them via beacon API to the backend service.

It works just fine for most of the users but I can see sometimes these types of logs.

currentWindow.removeListener is not a function
element instanceof currentWindow.HTMLElement - the right-hand side of 'instanceof' is not an object

currentWindow is just a variable I store when script loads. (const currentWindow = window). I am pretty sure the window object doesn't get altered from the user in any way and the window variable I store is not overwritten.

To me, it seems that window properties are getting cleared. I suspect it happens when the tab is (force) closed. I tried many things to replicate -- CPU throttling, force closing chrome etc.) I have literally no clue why it happens and cannot find any related info here or on google.

I should also note that it is not some issue with old browsers. It happens in the newest version of chrome as well as firefox.

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