58 points · by saimiam · 4y ago · 64 comments
I would love this block to go die in a server fire.
I'd go with a bookmarklet style approach suggested by other top-level comments.
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.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).
To do so:
- Open about:config
- Find or create permissions.default.shortcuts
- Set the value to 2 (BLOCKED) or 3 (PROMPT, not sure if that even works)
The changes should take effect immediately. If they don't, try restarting your browser.
You can then go into the page information dialogue (ctrl+I) and turn it back on for individual sites that need shortcuts to work well (like Google docs, maybe Discord).
Note that this might also affect shortcuts that do not conflict with your browser's shortcuts.
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...)
I use a dedicated browser for all types of banking as you can't be too careful. Also, I don't run any extension on it for this same reason of being careful.
I think you actually can. ;-) There's a difference between being prudent and living in fear. The former is of course good, but the latter can make someone miss out on a lot of good things in life. Including good software.
Even if it is benign now, there is no telling when it might be sold and new owners may have more nefarious intentions.
I'll never betray the trust of my users, and anyway it's not going to be sold. Nobody has ever made me an offer, and it's unlikely that anyone could afford to acquire it. The extension is worth more to me as an indie dev than it would be worth to anyone else.
Making it difficult to inspect element+replace value might actually be worth the effort. I've seen a Kitboga video where a simple transparent div covering the entire page had the scammed stumped for minutes because they didn't actually understand HTML.
It certainly doesn't prevent viruses, but for scams it may just be enough to save some people.
I suppose low level hindrances are sufficient to block low-level intruders...
It's a tricky trade-off. I don't think it's worth the effort and inconvenience to block the right click menu, but in the fight against scammers I can see why someone would see otherwise.
https://www.reddit.com/r/AnalogCommunity/comments/uw9fne/spe...
https://www.techdirt.com/2010/03/03/japanese-collection-soci...
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 :) ).
Code is also on github if you want to learn from it: https://github.com/lunu-bounir/allow-right-click
if you go back to the first few commits you see it started similar to some of the small JS snippets people have suggested here. It is interesting to see how it has evolved
For ins.tance you can shift right click a video to use picture in picture on Youtube
You can try, but you can't. The only people you'll stop are non-tech users, and the others will shame your business for playing this game.
If you need an analogy, think of it as trying to disable screenshots in an environment where users carry a camera in the other hand...
Don't have an exemple of when it would have failed :-)