Skip to content

Instantly share code, notes, and snippets.

@ahmadmysra
Forked from richard512/reenable-right-click.js
Created September 25, 2020 14:44
Show Gist options
  • Save ahmadmysra/ec8a70ce8a9e4a37560219c359822295 to your computer and use it in GitHub Desktop.
Save ahmadmysra/ec8a70ce8a9e4a37560219c359822295 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