Bypassing No-Right-Click Scripts

There are lots of legitimate reasons why you might want to access the context menu for an item in a web page so it is rather annoying when people use no right click scripts in the mistaken belief that it will protect their page.

Bypassing the script is very easy since these scripts only block the right mouse button (or left mouse button if you are like me and have the buttons reversed for left handed use). The scripts rarely block the alternative method of displaying the menu - via the keyboard.

The first thing to do is to check if your browser provides a way to turn off these "no right click" scripts as some browsers now do. If your browser provides an option to disable these scripts then simply turn on that option and you will never be bothered with these scripts again.

For those browsers that don't allow you to disable these specific scripts then one possible solution is to first ensure that the item you want to display the context menu for is selected. You may want to left click on it to select it, the best way if you want to select something that is not a link, or alternatively use the tab key on your keyboard to tab through the links on the page, which will select the link without activating it the way clicking on it would.

With the object selected it is a simple matter to press the shift and F10 keys on your keyboard which in your browser (like in most windows programs) is the keyboard equivalent to the right mouse button for displaying the context menu (or simply press the contextmenu button on the keyboard which is often found between the right alt and ctrl keys). From there you just select the entry that you want from the context menu just the same as you would have if you displayed the menu via the right mouse button.

This will be particularly useful for you if you browse pages with the navigation bar turned off and you end up on a very slow loading page and want to go back to the previous page as Back is one entry that always appears in the context menu for web pages. Just click anywhere on the page, press shift-F10 and then click Back and you are back on the previous page ready to make another selection. (Of course this is a bad example since Alt-left arrow will take you back to the previous page without having to display the menu at all).

A few web pages manage to disable the context menu for both mouse and keyboard. These usually work by coding oncontextmenu="return false" in the body tag. You can easily bypass this reactivating full context menu access by typing javascript:void oncontextmenu(null) into the address bar of your browser or see this page about JavaScript and no right click for how to create a bookmarklet that will always disable no right click scripts no matter how they are applied.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow