Skip to content

Instantly share code, notes, and snippets.

@weizman
Last active January 30, 2019 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weizman/a8cfdb85e0f6d6a7c1cd3ae756917d5d to your computer and use it in GitHub Desktop.
Save weizman/a8cfdb85e0f6d6a7c1cd3ae756917d5d to your computer and use it in GitHub Desktop.
demonstrate how normal actions can be performed within an `unload` event listener except for breakpoints
window.addEventListener('unload', (e) => {
console.log('unloading!'); // would successfully log to console
localStorage.setItem('key', 'value'); // would successfully set new item to local storage
debugger; // would fail to break at this point!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment