PDA

View Full Version : no right clcik and more


gafnad
07-19-2004, 02:22 AM
Any idea on where i can find a script that allows no right click to save the images that are on an html page and to prevent the user from dragging the image to their desktop?
Thanks in advance

gecko2
07-26-2004, 08:50 AM
Here's a bit of Javascript to disable the right click on a page.

<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>

tg
07-26-2004, 02:19 PM
there is always ways around stuff like that. in fact firefox has an extension available that will ignore this type of javascript (don't know how well it works).

Ruben
07-31-2004, 11:03 AM
there is always ways around stuff like that. in fact firefox has an extension available that will ignore this type of javascript (don't know how well it works).

Ahh, great, could you tell me where??

:D - Ruben

catbert303
07-31-2004, 12:53 PM
I'm not sure about firefox but in opera 7.5 you can go to

tools > preferences (alt + p)

then select multimedia and click the javascript options and make sure "allow script to receive right clicks" is unchecked (it should be by default)

tg
07-31-2004, 07:43 PM
you'll need to go to the firefox extension page, download and install the extension. not sure how well it works... not seen anything out there worth stealing.

Ruben
08-01-2004, 10:34 AM
Thanks tg and catbert303, I'll look into it, someday, maybe (maybe not ;))

:p - Ruben