4 ms·
I use a bookmarklet. It can be something basic, such as: javascript:void(document.oncontextmenu=document.onMouseDown=()=>true) ...which works for, maybe,
by genezeta 4y ago
I use a bookmarklet. It can be something basic, such as:
javascript:void(document.oncontextmenu=document.onMouseDown=()=>true)
...which works for, maybe, 60% of cases. Or you can try a more sophisticated one for greater success. e.g.:
javascript:(function(w){
var arr = ['contextmenu','copy','cut','paste'];
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);
Unfortunately, these don't work on 100% of the pages. Otherwise, as someone else has suggested, Firefox allows you to disable context menu hijacking for every site.
- lifeplusplus 4y agoTry making it immutable object
- genezeta 4y ago?