Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable right click without js and css [duplicate]

This is a random Chinese website http://www.soap-china.com/index.asp

I noticed that right click is disabled. I always have JavaScript off, so I started delete node by node, css line by line in Firebag, but didn't find out what is disabling right click.

How does it work?

This is not first time I see this, so I am curious about this trick.

like image 772
Qiao Avatar asked Aug 31 '14 22:08

Qiao


People also ask

How do I disable right click in HTML?

Disable right click menu in html page using jquery. JavaScript Code: $(document). bind("contextmenu",function(e){ return false; });

How do I disable copy and paste in CSS?

bind('copy paste',function(e) { e. preventDefault(); return false; });

Should I disable right click on my website?

It is pointless It does not protect your source code, images, or content. Disabling right-click and Ctrl+U will get users curious, wanting to know what it is exactly that you want to hide. This will end up being counter-productive to you as your images and source code will attract the attention of the tech survey.


2 Answers

On the body Tag do this:

<body oncontextmenu="return false">
...
</body>
like image 112
Umer Qureshi Avatar answered Sep 23 '22 11:09

Umer Qureshi


It is done with javascript.

I have disabled javascript and I can right-click. It disables with:

<script language="JavaScript">
document.oncontextmenu =new Function("return false;")
</script>    
<body onselectstart="return false">

There might be an issue with your browser, the site is online for me.

like image 22
Claudiu Creanga Avatar answered Sep 21 '22 11:09

Claudiu Creanga