What's new

How to to disable right click using javascript?

ebenzunlimited

Moderator
I am posting this article as per the one of my user request. It is easy to disable right click in a website using javascript.

Code to disable:
oncontextmenu="alert('right click is disable');return false;"

now you may have doubt about placing this javascript code. This code should be in body as one of the attribute.

I think you can understand better if i give example.
<body oncontextmenu="alert('right click is disable');return false;"
>

i think now you understand.

see , this will disabled only for usual internet users. You can not protect it from hackers. We can disable javascript simply using webtool bar add on
 
How to open links in new tab for sites whose right click is disabled

just place your mouse right at the very link you want to open
then hit ctrl+enter
links opens in new tab imediately

to disable the right click completely just
type the following into the URL bar of your browser:
javascript:void(document.oncontextmenu=null)

or do this

Hold the right mouse button, hit Enter to close the dialog box, and then release the right mouse button.




 
Top