I have a webpage (which I do not control):I...">

Right click enable: <body oncontextmenu = "return false">

I have a webpage (which I do not control):

<body oncontextmenu="return false">

I want to enable right click, but I just can't do it. In the saved html, when I deleted this one oncontextmenu, it started working.

I tried everything mentioned here , but it does not work for me.

A copy of the web page is saved here .

+4
source share
1 answer

Try the following code in the webdev console:

window.addEventListener("contextmenu", 
  function(e){
     e.stopPropagation()
}, true);
body,html {
  width:100%;
  height:100%;
}
<body oncontextmenu="return false">
 text
</body>
Run code
+5
source

Source: https://habr.com/ru/post/1676229/


All Articles