Allow Right Click on Chrome and Firefox

I hate websites that takes away the ability to right-click on the page. This is nothing more than script kiddie level of protection for those that think every visitor out there is a noob. You want to re-enable your rights to right-click but before you jump into adding yet another addon or extension into your web browser, it is good to find out if you really need to.

Before we begin

It is good to understand how they block the ability to right-click. There are heaps of answers to that. One such example can be found on StackOverflow.

Why re-enable right-click

Examples:

  1. To view source code
  2. To copy and paste using mouse
  3. To access context menu entries inserted by other browser extensions, such as LastPass. This is especially when pesky websites disabled the username/password autofill functionality.

Solution for most web browsers

In lament terms, we need to undo or override the blocking mechanism.

One of the ways is to execute the following javascript command:

javascript:void(document.oncontextmenu=null);

You can create a bookmark with URL having the above line for easy execution. Like I said, you need to assess if you really needed a browser extension before getting one.

A popular extension today may someday go rogue, becoming a malware because there is a lot to gain from and here are just a few points:

  1. Scraping web content using your connection thus your IP address
  2. Becoming a proxy server without your knowledge
  3. Observing form fields that you fill in
  4. Monitoring your browsing habits and selling that information
  5. Bitcoin mining
  6. Participating in a DDoS attack

When the one-liner fix is not enough

You have tried the one-liner fix but found that it worked on some but not on a few websites. One of the reasons is that they have implemented some sort of loop in Javascript that repeatedly imposed the right-click blocker.

In such a case, more needs to be done.

For Firefox

I like that Firefox allows more controls than Chrome especially on aspects of security. That is probably why Tor browser is based on Firefox.

Type about:config into Firefox location bar. You will be presented with a warning dialogue. Proceed of course.

Then look for dom.event.contextmenu.enabled and toggle the value to false.

For Chrome

As at time of writing this article, you will have to resort to installing a browser extension.

I have tried a few extensions and most tend to apply the same one-liner fix which is obviously insufficient hence needing a better antidote.

The best fix for now is:

  1. Installing Tampermonkey
  2. Then install a script. This piece of code is open source so can be inspected.

Conclusion

The above works well for me. You may have different ways of achieving the same goal. Please share your comments below.