Live data from Hacker News

Ask HN: How to disable right-click blocking in the browser

news.ycombinator.com

1–10 of 66 posts

Re: Ask HN: How to disable right-click blocking in the browser

#2
Add 'tamper monkey' extension to your browser and look through the source what class to remove from elements you are interested about.

Above comes with disclaimer, I personally don't allow any extensions in browser I use for banking. A little bit paranoid but I prefer to reduce plain of attack when accessing my bank (of course there are other threats that may bring more severe risk, remove them one at a time :) ).

Re: Ask HN: How to disable right-click blocking in the browser

#3
I use Firefox and on Firefox this can be done by typing "about:config" (without the quotes) in the address bar, then searching for "dom.event.contextmenu.enabled" (without the quotes) and then double-clicking on the result to toggle its value from "true" to "false".

Re: Ask HN: How to disable right-click blocking in the browser

#5
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.

Re: Ask HN: How to disable right-click blocking in the browser

#8
Related: I'd LOVE to know how to force standard ctrl + f behaviour on sites that override it.

Same for sites that override ctrl + left click (to open link in new tab - some sites will treat it like you simply clicked the link and open it in the same tab - super annoying).

Re: Ask HN: How to disable right-click blocking in the browser

#10
post #4

[self-promotion] My extension StopTheMadness stops this (supports all web browsers on macOS): https://underpassapp.com/StopTheMadness/

So the solution is to give the extension access to your banking site? Doesn't seem ideal.

Extension permissions still can't block an extension from making network requests if they have access to a site, right?

(Not implying this extension does something nefarious, but more the general risk of such extensions especially when we hear that sometimes extensions get sold or their authors accounts get compromised...)

Post reply on HN