Last active
October 14, 2022 15:27
-
-
Save fabi6ferreira/a416016f6ae0e1bc80f67f8c6305b651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('beforeunload', (event) => { | |
// Cancel the event as stated by the standard. | |
event.preventDefault(); | |
// Chrome requires returnValue to be set. | |
event.returnValue = ''; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment