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

153
Views
Window.onUnload on all tabs

I'm researching if there is a way that window.onunload event gets fired on inactive tabs in Chrome browser.

The idea is that if i keep a page's tab active (let's say its index is 3), the event will fire if I (for example) close the browser. However, if i am navigating on some other page(s), the onUnload event on tab-index 3 (my page) will not fire (as it is not the active tab)

To my opinion, I would have thought that onunload gets fired for all tabs in the browser... but as to my tests... it only fires on the active-tab.

Is there any way to register a listener to detect if the browser closes even if (my) site is not lucky to sit in the "active" tab?

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!