How to re-enable right click

Some news site still try in 2021 to disable right click and ability to copy content. These tactis are very very poor, and only block the users not interested in copying/stealing your code.

The  idea is to put something like that on body tag:

<body oncopy="return false" oncut="return false" onpaste="return false" onbeforecopy="return false" ondragstart="return false" onselectstart="return false" oncontextmenu="return false">

The code to re-enable it is easy to find out:

var elements = document.getElementsByTagName("*");
for(var id = 0; id < elements.length; ++id) { 
 if (elements[id].oncontextmenu!=null) {



This entry was posted in English Content, IT Featured, Knowledgebase and tagged . Bookmark the permalink.