0

I used this piece of code form a website that disables JS. When I right click, the pop up box appears. I'm not JS savvy and I don't know how to disable it. I just want the action itself, not the message. Any help would me appreciated!

 <script language=JavaScript>
     var message="Function Disabled!";

  if (document.layers){
   document.captureEvents(Event.MOUSEDOWN);
   document.onmousedown=clickNS4;
  }
   else if (document.all&&!document.getElementById){
   document.onmousedown=clickIE4;
  }

  document.oncontextmenu=new Function("alert(message);return false")
</script>   
  • 1
    It could be your answer https://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page – Pramod Kharade Sep 22 '20 at 18:13
  • Mmmmh, maybe I'm wrong because I don't really read you code, but I see a little `alert` at the end of you code. Maybe you could look on the web what does it mean (hint: it "alerts" the user about something) – Adrien Kaczmarek Sep 22 '20 at 18:22
  • Please clarify: Do you want to (a) remove the message alert, or (b) disable right-click? If (a), try `document.oncontextmenu=null;`. If (b), don't... :). To get to dev-tools use [CTRL]+[I]. – iAmOren Sep 22 '20 at 20:09

0 Answers0