Skip to content

Instantly share code, notes, and snippets.

@richard512
Created July 7, 2017 01:55
Show Gist options
  • Save richard512/accd9b489c655bf159fcd9be9e099b7f to your computer and use it in GitHub Desktop.
Save richard512/accd9b489c655bf159fcd9be9e099b7f to your computer and use it in GitHub Desktop.
re-enable right click (bookmarklet)
javascript:(function(w){
var arr = ['contextmenu','copy','cut','paste','mousedown','mouseup','beforeunload','beforeprint'];
for(var i = 0, x; x = arr[i]; i++){
if(w['on' + x])w['on' + x] = null;
w.addEventListener(x, function(e){e.stopPropagation()}, true);
};
for(var j = 0, f; f = w.frames[j]; j++){try{arguments.callee(f)}catch(e){}}})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment