Skip to content

Commit

Permalink
feat: test beforeunload compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Leoglme committed Feb 18, 2024
1 parent d7b5c4a commit f715df3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/mon-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@

// For ios
window.addEventListener('pagehide', () => onLeave('pagehide'))

document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'hidden') {
onLeave('visibilitychange');
}
});
})()

0 comments on commit f715df3

Please sign in to comment.