Jump to content

disable right click


farbod.de

Recommended Posts

Not sure what is the purpose to disable right click.

 

if you just want to disable the contextmenu, you can use

<body oncontextmenu="return false;">

You can also try to add following code to product page theme file, 

document.onkeydown = keyboardDown;
document.onkeyup = keyboardUp;
document.oncontextmenu = function(e){
var evt = new Object({keyCode:93});
stopEvent(e);
keyboardUp(evt);
}
function stopEvent(event){
if(event.preventDefault != undefined)
event.preventDefault();
if(event.stopPropagation != undefined)
event.stopPropagation();
}
function keyboardDown(e){
...
}
function keyboardUp(e){
...
}

If you Google, you may find more and best fit your needs.

Actually above script is what I googled. not tested yet, you need to try by yourself.

 

product page theme file is located

 

/themes/YourThemeFolder/product.tpl

Edited by shokinro (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...