Skip to content

Instantly share code, notes, and snippets.

@ahmadmysra
ahmadmysra / reenable-right-click.js
Created September 25, 2020 14:44 — forked from richard512/reenable-right-click.js
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);