document.addEventListener('contextmenu', event => event.preventDefault());
That being said: DON’T DO IT.
Why? Because it achieves nothing other than annoying users. Also many browsers have a security option to disallow disabling of the right click (context) menu anyway.
Not sure why you’d want to. If it’s out of some misplaced belief that you can protect your source code or images that way, think again: you can’t.
How to Enable Right-Clicking on Web Sites That Block It:
Even better, you can create a bookmarklet out of that code so it’s always just one click away. Select the code above and drag it to your browser’s toolbar (or wherever you store bookmarks). Rename it something that makes sense to you, but leave the code intact for the URL.
Enable Right-Clicking and Copying on All Sites with a Browser Extension
In Chrome, we recommend installing the RightToCopy extension. As its name suggests, it does more than just enable right-clicking. It also enables text selection and copying on sites that have disabled those functions, and even removes text that web sites inject into the text you copy (such as “Read More at…”).
Unfortunately, there is no directly comparable Firefox extension at this time. Of course, there are more comprehensive script blocking extensions available, such as NoScript (Firefox) and ScriptSafe (Chrome). Extensions like these block all scripts from running on any web pages unless you enable it. Both are worth looking into for a little added peace of mind, but note that they can be problematic on sites that use scripts for useful features.
And that’s it. Disabling right-clicking on web pages may be only an occasional problem, but it’s annoying when it happens. It’s also super easy to fix.
How to get around websites that block right-clicks:
If you’ve ever tried to right click on a website to copy or share content, you may have noticed it doesn’t work: Congratulations! You just ran into a site that blocks right-clicking and other methods of directly accessing content.
This can be very annoying, especially if all you want to do is share a funny quote, or post a link to content on your social feeds. However, there are ways of getting past this right-click blocking. If you’re willing to try out a few new tools, we’ll show you the best – and safest – ways to do it!
(Also, we hope we don’t have to say this, but please respect intellectual property, hard work, copyrights, and all that other important stuff when using these workarounds.)
Picking the right browser
Option 1: Use plugins
Allow Copy (Chrome): Allow Copy is ideal if you want to do a lot of sharing or copying throughout the day and find frequent right-click blocking very intrusive. The extension puts a little button on your toolbar. Surf on over to a copy-protected website, turn this button on, and it will strip away those blocks. Once you are finished with all your clicking, turn the button back off, and resume your work. Note that this enables not only right-click options but also text copy and other features.
Option 3: Proxy Sites
How to Bypass Right Click Block on Any Website
You might remember an experience where you tried to right-click on a web page but got a pop-up message saying that the “right-click functionality has been disabled”. Sometimes you may be trying to copy an image or view the source of a web page but when the right-click is disabled, these things would seem impossible. Bank websites and other sites that require a secure transaction such as a payment gateway are the ones to impose this kind of limited functionality on their pages. In this post, I will show you the ways by which you can easily bypass right-click block feature on any website.
For Internet Explorer:
If you are using IE, just follow the steps below:
- From the menu bar, go to Tools -> Internet Options.
- In the “Internet Options” window, switch to Security tab and click on the button Custom level…
- From the Security Settings, look for the option Active scripting and select the Disable radio button as shown above and click on “OK”.
- You may even select the Prompt radio button, so that each time a page is loaded, you will have the option to either enable or disable the scripting.
For Google Chrome:
- Click on the Chrome “menu” button (on the top right corner) and select Tools.
- From the “Settings” page, click on Show advanced settings…
- Now under Privacy, click on the button Content settings…
For Mozilla Firefox:
- From the menu bar, click on Tools -> Options.
How to Bypass the Right Click Block?
How to enable right click on websites that have disabled it
In one of our previous posts, we have seen how to save images to your PC, when right-click is disabled. Now let us take a look at how to enable right click on websites that have disabled it, and copy text from the web page.
While browsing, we often come across useful information in random websites, but when we want to note it down, our efforts go in vain when we see a window saying “Sorry, this functionality has been disabled by the administrator” because the right-click option has been disabled by the site administrator. If the information is a how-to guide or something then it could be a lifesaver for us at times. Clearly, jotting it down or paraphrasing it again is a laborious activity. One option would be save the entire web page for offline reading. But if you need to copy only parts of the text, then these options may make more sense.
How to enable right click on websites
Let us take a look at some of ways to re-enable right click on websites & copy from right click disabled websites or blogs, which have turned it off on their web pages, via browser settings or by using third-party tools.
A] Without Third Party tools
1. Using a Code method
In this method, all you need to do is remember the below string, or right it down at some place safe:
From now on, whenever you come across a web page, in which the right-click option has been disabled, just copy the above code, paste it in the browser address bar and hit enter. That’s it!
You will now be able to access the right-click context menu options on the fly. But, the downside here is you need to use it every time in order to access the right-click menu.
3. Other methods
If your intention is just to copy text from the web page then you can do it easily either by looking into the source code of the web page. Hit Ctrl+U and find the required text and then copy.
The other way is to save the web page to your computer, using Ctrl+S shortcut, double-click to open it and then copying the necessary text area.
B] Using Third Party Tools
If you aren’t that much into checking the internals of your browser, there are always other ways using which you can get over with this.
1. Using Web Proxy
Simply put, a web proxy is something which sits between you and the Internet and lets you browse websites anonymously by hiding your details such as IP address. You can go to a site which offers web proxy, such as hide.me or filterbypass, and enter the URL of the web page where right-click option has been disabled. Check the Remove Scripts option which prevent the site from running any scripts and go.
2. Using Browser Extensions
If you can’t find comfort in any of the above methods, you can always seek help from the web store. Just install the extension in the browser which does the job without giving you any headache. There are many extensions available for this purpose. You can check out RightToCopy for Chrome or Right To Click for Firefox.
NOTE: Always respect Copyrights. Many a times, websites disable the right click option, because of copyright issues as they do not want their content to be noted down. If the text you are handling with has copyright issues, you need to be careful while reproducing it. Nothing illegal has been suggested here – only workarounds using your own browser and third-party tool which are available on the official Google & Mozilla websites.