Discouraging Internet Photo Thieves

Steve Miller TX

In light of the recent rampage of storm photo thieves and rustlers, I thought this would be relevent to all chasers with a website. While not a total prevention, this will help discourage those wanting to swipe your photos from your website using the left click of a mouse. They'll have to work at it. Here is the javascript to do that:

<script>

msg="Nasty message goes here";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(msg);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(msg);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

</script>


To see this in action, go to: http://www.texastailchaser.com/2005blog/20...50531/index.htm
 
That is not foolproof. It can be over-ridden by clicking with both mouse buttons at the same time, when the right-click menu will come up normally. Least it does on both of my computers.
 
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus ([email protected]) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="RIGHT CLICKS DISABLED ON THIS SITE!";

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




Above is a disable right click code. It's usually a good theft deterrent, but have heard it's not completely foolproof.
 
Doesn't work with Firefox

Hi Steve,

I didn't have any problems using the right click with Firefox. I noticed when I hit your main site that I got a message about your site not supporting Netscape, but going directly to your link didn't cause me any problems.

James
 
That is not foolproof. It can be over-ridden by clicking with both mouse buttons at the same time, when the right-click menu will come up normally. Least it does on both of my computers.

Anthony's code which includes the second or third mouse button *should* take care of this. I had forgotten about those fancy mice. Be sure to let us know if you can still get around it with mouse clicks.

A thief could still grab your image by reviewing your source code and deriving the url path to the image. That requires some actual work though. This is only intended to eliminate the casual thief with neither the patience nor the know-how of working around this. Regardless of what type of thief, they will try the right click thing first and at least on my site get a nasty warning message. ;-)
 
Re: Doesn't work with Firefox

I didn't have any problems using the right click with Firefox. I noticed when I hit your main site that I got a message about your site not supporting Netscape, but going directly to your link didn't cause me any problems.

Hmmm....did you try the code that Anthony provided? Firefox should trigger a Nestscape event. I'm about to hit the sack, but I'll tinker around with this more tomorrow. Maybe we can all together create some code that will fry the thief's motherboard. LOL
 
Im still able to right click and save images with the latest version of Opera.

Dang...forgot about the Opera browser. Perhaps we can add code to block anything other than IE or FF? I do that on my main site to restrict it to IE only because of all the complex DHTML I use and was too lazy to code for NS (this was well before the rise of FireFox though).
 
One can simply turn javascript off in something like Firefox. You'll have a hard time restricting to a specific browsers as well. If someone wants to they are most likely going to steal your pictures, might as well as not spend the effort in doing this. A simple copyright notice on the image is going to be as good as you can get without taking away from the image.
 
Back
Top