I often mockup page changes using Chrome’s dev tools.
I’ll get a page just right, then later accidentally click a link or close the page and lose my changes.
This bookmarklet, once clicked will protect you from premature page exits.
It disables link clicks, form submissions, page reloads and exits.
Add it by going to this jsFiddle page, and dragging the green link to your bookmarks bar:
http://jsfiddle.net/R7QKP
Here’s the JavaScript:
javascript:window.onclick=function(){return false;}, window.onsubmit=function(){return false;}, window.onbeforeunload=function(){return 'Page Protection is enabled';};
Ernie@Laptop Repairs
Looks good. At least users can save time and energy instead of repeatinge everything from scratch with just a wrong click. This is really a helpful code snippet, thanks :)