Skip to content

What is ‘Void Document Oncontextmenu Null’? How to enable right-click?

  • by
  • 4 min read

A lot of websites implement several tools to keep their content from being stolen. However, at times these countermeasures can go a bit too far and hinder functionality. 

In this article, we’re talking about Javascript’s void(document.oncontextmenu=null); function, what it does and how you can bypass it to access the context menu. 

What does it do?

void(document.oncontextmenu=null) is a simple bit of Javascript code that allows the right-click menu, otherwise known as the context menu, on web pages that have blocked this functionality. 

Note that there are a number of ways the context menu can be blocked, including several ways in Javascript itself. To unblock it, all you have to do is navigate to the webpage you want to modify, type void(document.oncontextmenu=null) in the URL bar and hit enter. 

Do keep in mind that you will have to do this every time you want to access the context menu. 

Also read: Chrome Autofill not working: 6 Fixes

Alternative ways to access the context menu

In case this method doesn’t work, you can try any of these alternatives.

Try using the reader mode

A quick trick that you can try is to enable reader mode in your browser. Try pressing the F9 button to enable your browser’s reader mode, and try copying the text you want from here. 

Disable Javascript altogether

Now, this is a bit of a drastic method considering it’ll most likely break quite a few web pages. However, you should be able to access the context menu just fine. 

Step 1: Head to Chrome’s Javascript settings. You can access them directly at chrome://settings/content/javascript.

What is 'Void Document Oncontextmenu Null'? How to enable right-click?

Step 2: Under Default behaviour, ensure that Don’t allow sites to use Javascript is enabled. 

What is 'Void Document Oncontextmenu Null'? How to enable right-click?

Now refresh the page you were on, and you should be able to access the context menu just fine. 

Also read: How to hide tabs in Chrome?

Use the source code

Another age-old technique to copy code snippets or content from a site is to access the page’s source code. This works nearly every time and is relatively easy to do as well. All you have to do is press Ctrl + U on your keyboard, and you’ll be able to access the site’s source code. 

HTML source code isn’t exactly easy to comb through, but you’ll find everything you need.

Once here, you’ll have to shuffle around a bit to find what you’re looking and then you can copy it without a problem.

Save the webpage

Another thing you can do is save the entire webpage and open it locally. All you have to do is press Ctrl+S on the webpage you want, and your browser will save it for you. Once saved, open the webpage locally, and the context menu will work just fine. 

Using Proxy Servers

Using Proxy servers is a hit or miss method when you’re looking to dodge context menu blocks. Regardless, it’s a simple method that is worth a try. 

All you have to do is head over to a proxy server website such as or FilterByPass. Just type the page’s URL, and you’ll be able to browse it just like you usually do, except this time, the context menu should be working fine. 

Using browser plugins

Several third-party browser plugins or extensions can also help you get around this problem and access the context menu. Allow right-click – simple copy and Ultimate Enable Right Click ─ Allow Copy are two extensions that’ll work on Chrome and other Chromium-based browsers such as Edge. 

Also read: How to invert colours on Chromebook?

Yadullah Abidi

Yadullah Abidi

Yadullah is a Computer Science graduate who writes/edits/shoots/codes all things cybersecurity, gaming, and tech hardware. When he's not, he streams himself racing virtual cars. He's been writing and reporting on tech and cybersecurity with websites like Candid.Technology and MakeUseOf since 2018. You can contact him here: