PDA

View Full Version : How to create a pop up when someone right clicks, as if to copy your text



mdvari
Sep 8th, 2003, 05:12 PM
I've long wanted to create some sort of code when people try to lift your text by right clicking. I've seen some with a dynamic drive coding that remind people the material is copyrighted.

What is this trick? And I'm assuming that if someone really wants your info, they can get it, but this could be a viable deterent.

Thanks! You can email me on the board, but great if you can also copy me at [email protected]

sage45
Sep 8th, 2003, 06:22 PM
Sure thing,

Here is one I just grabbed/borrowed from a website that had the no-right click script... Unfortunately, there was no copyright information within the script so the author cannot get the original credit he/she deserves:

<SCRIPT language=JavaScript>
var w456=false;
function nrcie(){
return false;
}
function nrcns(e){
if(e.which==2||e.which==3)return false;
}
if(document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=nrcns;
}
document.oncontextmenu=nrcie;
document.onselectstart=new Function("return false");
function wwddd(){
window.status=" ";setTimeout("wwddd()",10);
};
wwddd();
function p8735(){
for(i=0;i<document.all.length;i++){
if(document.all[i].style.visibility!="hidden"){
document.all[i].style.visibility="hidden";document.all[i].id="h27w";
}
}
};
function p9346(){
for(i=0;i<document.all.length;i++){
if(document.all[i].id=="h27w")document.all[i].style.visibility="";
}
};
window.onbeforeprint=p8735;
window.onafterprint=p9346;
</SCRIPT>

-sage-

brothercake
Sep 8th, 2003, 09:47 PM
It's not a viable deterent at all - it will stop no-one, while inconveniencing many who just want to use the context menu for its normal purpose.

sage45
Sep 8th, 2003, 10:05 PM
Thats why I pointed out to the user that I grabbed it from a site that had "no right click enabled" ;)

-sage-

brothercake
Sep 8th, 2003, 10:29 PM
Ah sorry - I missed the irony there ...