DEV Community


Discussion on: Sure you want to leave?—browser beforeunload event

samthor profile image
Sam Thorogood Author

Moving to another page can be detected by watching focus or the Page Visibility API. The page is still open in that case, just hidden or not being used by the user.