Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enabling right click: <body oncontextmenu="return false">

I've a web page(which I don't control) with:

<body oncontextmenu="return false">

I want to enable right click but there's no way I'm able to do it. In the saved html when I removed this oncontextmenu then it started working.

I've tried all mentioned here, but it's not working for me.

Here is the saved copy of web page.

like image 265
user5858 Avatar asked May 03 '17 07:05

user5858


1 Answers

Try to execute the bellow code in webdev console :

window.addEventListener("contextmenu", 
  function(e){
     e.stopPropagation()
}, true);
body,html {
  width:100%;
  height:100%;
}
<body oncontextmenu="return false">
 text
</body>
like image 121
Spring Avatar answered Sep 28 '22 10:09

Spring