Forum Moderators: open

Message Too Old, No Replies

disable or block right-click menu

Can I do that?

         

urielm

10:16 pm on Nov 16, 2004 (gmt 0)

10+ Year Member



I need to block or disable functions as cut, copy, save as, etc. from the right click menu, or if possible at the browser's menu. This is just to prevent copy and use of copyrighted information & images. I don't mind the use of functions as printing.

Actually I have the next script, but it doesn't seem to function completely in what I really need:

<script language=JavaScript>
<!--
var message="Derechos Reservados - Teflex 2004";
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;
}
}
}

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

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>

nancyb

10:49 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hello urielm and welcome to WebmasterWorld! [webmasterworld.com]

This has been disucssed many times and you might find this search [google.com] helpful.

As you will find, adding all the script to you page will not prevent anyone who wants your content from getting it and it will only slow down your page. Once youv'e been visited, your images are cached on the user's machine and there are other simple tricks to use other than right click to get/copy your content.

urielm

11:24 pm on Nov 16, 2004 (gmt 0)

10+ Year Member



I'm talking about the most common type of users, the ones that will not go further looking for the code or images, just to discourage&prevent from undesirable users to copy and use my information, for their bennefit.

I mean my visitors include my business competitors, and I don't want to have this as easy as cut&paste.

piskie

12:24 am on Nov 17, 2004 (gmt 0)

10+ Year Member



If they are clever enough to use it, they are clever enough to copy it. For instance you can just turn of JavaScript with a click or two in most browsers.

Sunshyn

9:16 am on Nov 17, 2004 (gmt 0)

10+ Year Member



I agree with Piskie. For being that ineffective for the use you want, it's MUCH more annoying to those of us who navigate primarily with the right-click menu. I used to avoid sites which disabled right navigation just because it was so annoying having to alter my way of browsing or having to click pop-ups when I forgot. I also made a point of not buying anything from such sites until I started using Opera almost exclusively. Now the stupid things don't work on my browser so I don't even notice when someone is attempting to restrict my browsing ability.

matthewwithanm

1:56 am on Nov 18, 2004 (gmt 0)

10+ Year Member



I agree, completely annoying. Stops IE users from opening links in new window but stealing content is as easy as File, Save.