Skip to content

Instantly share code, notes, and snippets.

@maxw3st
Forked from tbwiii/Don't Close Me, Bro
Created November 14, 2012 21:30
Show Gist options
  • Save maxw3st/4074968 to your computer and use it in GitHub Desktop.
Save maxw3st/4074968 to your computer and use it in GitHub Desktop.
A Bookmarklet that keeps you form accidentally closing a tab you wanted to keep open.
javascript:(function(){window.addEventListener('beforeunload',function(){return"Whoa bro, you tried to close me. \n Did you mean to do that?"})})();
javascript:(function(){window.addEventListener('beforeunload',function(){return"Whoa bro, you tried to close me. \n Did you mean to do that?"})})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment