question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window never fires beforeunload/unload events

See original GitHub issue

Hello!

window.onclose = () => console.log("I'm out!")
window.close()

Well, this piece of code isn’t working correctly. The window memory is freed, but the event is not triggered. Is this expected to work?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
sharifzadesinacommented, Apr 30, 2019

Any fix for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why onbeforeunload event is not firing - Stack Overflow
3) It is fired only if there was ANY interaction of the user with the site. Without ANY interaction (even one click anywhere)...
Read more >
unload And beforeunload Events And How To Debug Them ...
Order: beforeunload will always fire before unload event (makes sense ... other windows beforeunload events would fire after top window ifr.
Read more >
Window: beforeunload event - Web APIs | MDN
The beforeunload event is fired when the window, the document and its resources are about to be unloaded. The document is still visible...
Read more >
Sure you want to leave?—browser beforeunload event
use the beforeunload event to warn a user they're going to close your page, but only when it's important · a Set of...
Read more >
Page: DOMContentLoaded, load, beforeunload, unload
The beforeunload event on window triggers when the user wants to leave the page. If we cancel the event, browser asks whether the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found