43

I despise web sites that hijack my right mouse button via javascript. Other browsers ( like firefox) allow me to block sites from doing this. Does chrome have such an option, or does it leave me at the mercy of annoying web site designers?

EDIT: I don't want to turn off javascript completely. I just want to block javascript from taking over my right mouse button. Firefox lets you stop javascript from doing specific things like this. I am trying to find out if Chrome does as well. I am going to assume it does not at this point.

15

Try this Chrome extension, it specifically stops websites from blocking the right click button.

Enable Right Click

https://chrome.google.com/webstore/detail/enable-right-click/hhojmcideegachlhfgfdhailpfhgknjm

  • this looks promising! – Peter May 10 '11 at 14:08
  • 4
    It's really disappointing chrome requires an extension for this, but it does address the problem. Voted up answer, but still looking for any better solution. – J. M. Becker Mar 30 '12 at 23:44
  • This worked like a charm. I was getting ready to build my own extension. Yay for research. – Till Sep 17 '12 at 11:45
  • 7
    @Karl Morrison: I think you may have misunderstood my criticism, I wasn't criticizing chrome for disabling the right-click menu. I was irritated that chrome doesn't provide a method to selectively disable Javascript functions. Also want to mention disabling JavaScript will render many sites nonfunctional. Firefox provides a "Disable or replace context menus" Javascript option. – J. M. Becker Oct 22 '13 at 2:02
  • 1
    @Alexander, Doesn't work. Tested on Google Docs using Chrome browser. – Pacerier Aug 20 '16 at 2:36
13

Press F12 to bring Google Chrome Developers Tools out and navigate to Console tab and run below command:

document.oncontextmenu=null;

It should bring most of the context menu back.

It should work for Firefox as well.

Of course on Firefox you could just use Shift + right-click to bypass the JS context menu.

  • 7
    Doesn't work. Tested on Google Docs using Chrome browser. – Pacerier Aug 20 '16 at 2:33
  • @Pacerier I don't know what voodoo magic did Google cast on Docs, it is not utilising oncontextmenu and thus my solution doesn't work. However, the other method I mentioned should work under Chrome as well, use Shift + right click to bring up the original context menu. – Shi B. Nov 29 '17 at 7:34
  • Doesn't work for me. – Ben Wheeler Aug 11 '18 at 21:59
  • 1
    To counter the "doesn't work" comments - this does work, it may not work for every web site, but the answer from @shi-b does work... – Robert Swift Jan 25 at 9:25
4

I found an acceptable solution, from About.com. It's a small bookmarklet, which by nature must be clicked to force disable this particular annoying JS. However I find it better than the Firefox style option, as many sites need right-click controlling JS. For example Google Docs etc...

At least I don't need to waste resources storing an additional extension in memory. You can watch how chrome stores extensions with its task-manager, of coarse you need an extension installed to watch.

2

I use NotScripts

EDIT:

I have switched to ScriptNo, which has more granular control

  • 1
    Does that let you control what javascript can and can't do on a page, or does it just block javascript altogether? – Peter May 5 '11 at 19:23
  • It blocks js by domain, each domain selectable by you, depends on what you mean by hijacks your right click, do you mean it changes your context menu? – Moab May 5 '11 at 21:44
  • 3
    yes. i want the ability to stop javascript from using mouse click events that come from my right mouse button. – Peter May 6 '11 at 18:51
  • Another solution non grata, but a big step above completely disabled JS. I've used FireFox noscript, which is still hardly usable, but Chrome notscripts is actually even worse. They both require a grip of manual intervention, and basically just enable/disable JS completely per domain. If you want to solve the problem, of fine-grained specific JS DOM disabling, both do not suffice. Although by skin of the teeth, it's just good enough to avoid my downvote. – J. M. Becker Mar 30 '12 at 23:41
  • @TechZilla check my edit above – Moab Mar 31 '12 at 0:20
-1

You can easily enable/disable or allow/block javascript on any website in Google chrome. Just click on paper sign before the site url. Under permisions you will see javescript, click down arrow you will see a menu, select "Always block on this site" and reload web page so changes can take effect.

Hope this will help.

Here is link to image.

https://www.facebook.com/photo.php?fbid=10201389704683447&l=5294c0075e

  • 2
    I am not trying to block all javascript. I only want to block javascript from intercepting right mouse clicks. Some browsers give you that option. – Peter Sep 4 '13 at 3:15
-1

I found this chrome extension RightToCopy

it enables right click and select and copy text feature from sites.

-1

Building on Shi B. solution I got a reliable way of solving the problem on Google Chrome.

(1) Get custom-javascript-for-web plugin for Chrome.

(2) Paste document.oncontextmenu=null; into the plugin's console.

Works like a charm.

  • (I know this is old, but I'm too curious to let it be) Why in the world would you use that instead of the default console for this? To me it just looks like a harder way to achieve exactly the same. – Dennis Krøger Mar 8 '18 at 9:44
  • 1
    in my case, I was coming back to the same website (Dropbox Paper). So it automatically had that script executed for one website. Fortunately, the company fixed it – Karolis Mar 9 '18 at 1:06
  • document.oncontextmenu=null; doesn't work on sheets.google.com in chrome. – xaxxon Jul 10 '18 at 21:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.