Page 1 of 1
Please help: Adding Script to Disable Right Click Mouse Func
Posted: Tue Dec 14, 2010 11:24 pm
by nasrul89
I want to turn off the mouse right click function on my browser when opening the site OpenCart to protect the image by copying others.
I found the script below, but I am confused where to place it ... please help.
This script, if the scripts are correct, I also do not know.
<script language=JavaScript>
<!–
var message=”Function Disabled!”;
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
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>
examples of websites that disable right-click mouse functions:
http://www.butik-gaya.com/
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Wed Dec 15, 2010 12:17 am
by Qphoria
This is a complete waste of time. People are smart enough now to just disable javascript and then they can click anything they want. disable right click scripts haven't worked since 1999.
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Wed Dec 15, 2010 12:22 am
by SapporoGuy
Add it to the header.tpl
However, You still can get to your images by:
1.) view page source, then copy paste ... here is a link
http://www.butik-gaya.com/images/ANTING ... BIRUcp.jpg
Is that your site?
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Wed Dec 15, 2010 12:25 pm
by nasrul89
at least to reduce the risk of copy-paste the image and people can not see our source page.
mr. SapporoGuy and mr. Qphoria
thanks for the help and info.

Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Wed Dec 15, 2010 3:50 pm
by SapporoGuy
You should look into watermarking your images if you are that worried.
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Mon Dec 20, 2010 10:41 am
by scr33ky
Well .. i tryed watermarking.... made the mod.. from the instructions on the forum.. my employer even payed 13 $ for a decent watermark module and afterwards ..LOL he decided that the overall look is ruined by the watermarking ..... because if you have other images besides the products on the page .. like manufacturere logos.. they will tend to override them aswell.. that and some image sizes differ on the image sourece.. that can have some unexpected results aswell.. i managed to install a "right-click disable"script in the catalog/view/theme/default/template/common/header.tpl
just before the </head> tag in the header.tpl
add this script
Code: Select all
//--></script>
<SCRIPT LANGUAGE="JavaScript">
var message="Right Click Deactivated !";
///////////////////////////////////
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>
DEMO:
http://www.magazin-scule.ro
Sure it might not do the job in all situatons but at least it will make it harder for others to right click .... at least try to discurage the right click behavior of the people that visit your site
Well good luck all hope i helped ..
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Sat Feb 26, 2011 10:07 pm
by KuriN
Is there a way to disable the selection on your store? Nomatter text or picture.
http://www.parfumi.net/catalog/yves-sai ... -5258.html
- Like here... try to select the text...
Thanks
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Sat Feb 26, 2011 10:38 pm
by SapporoGuy
I still think this is a waste of time since those who will want to protect images or text, since you still can get them through google search or Safari/Chrome by opening the debugger. View source is a way to get text.
Re: Please help: Adding Script to Disable Right Click Mouse
Posted: Fri Apr 01, 2011 5:41 am
by smorelli
Not to mention, they can just to a screen print and crop up the image.