<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Alan,<BR>
This problem has been discussed earlier in this forum, but I don't remember<BR>
the conclusions.<BR>
&nbsp;<BR>
FIRST STEP&nbsp; -&nbsp; (Preventing Browser cache)<BR>
&nbsp;<BR>
&lt;HTML&gt;<BR>
&lt;HEAD&gt;<BR>
<BR >&lt;META HTTP-EQUIV="Expires" CONTENT="-1"&gt;<BR >&lt;META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"&gt;<BR>
&nbsp;<BR>
&lt;/HEAD&gt;<BR>
&lt;BODY&gt;<BR >&lt;DIV style="width:200; height:128; background-image:<FONT class="">url</FONT>('precious.jpg')"&gt;&lt;/div&gt;<BR >&lt;/BODY&gt;<BR>
&lt;HEAD&gt;<BR>
&nbsp;<BR>
&lt;META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"&gt;<BR>
&nbsp;<BR>
&lt;/HEAD&gt;<BR>
&lt;/HTML&gt;<BR>
&nbsp;<BR>
This code has a triple action against browser caching.<BR>
(Keep it exactly as is - yes, both headers in the same order of document flow)<BR>
|||||||This code will suffice for Opera 9 - no other actions required|||||||||<BR>
&nbsp;<BR>
SECOND STEP&nbsp; -&nbsp; (Clearing RAM, unloading images on suspicious user action)<BR>
&nbsp;<BR>
&lt;SCRIPT&gt;<BR >&nbsp;var alles=document.getElementsByTagName("DIV")&nbsp;<BR>
&nbsp;var tmpImages=new Array();<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp; for(i=0;i&lt;<FONT class="">alles.length</FONT>; i++){<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tmpImages[i] = alles[i].style.backgroundImage&nbsp; } <BR >&nbsp;<BR>
function clearRAM(){<BR >&nbsp;&nbsp;&nbsp; for(i=0; i&lt;<FONT class="">alles.length</FONT>; i++){<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alles[i].style.backgroundImage = "url(imageoffline.jpg)"//you may chose to either leave it empty or give a warning image<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
function restoreImages(){<BR >&nbsp;&nbsp;&nbsp; for(i=0;i&lt;<FONT class=""><FONT class="">alles.length</FONT>;i</FONT>++){<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alles[i].style.backgroundImage = tmpImages[i]<BR >&nbsp; }<BR >&nbsp;}<BR>
&nbsp;<BR>
onblur = clearRAM<BR >onfocus = restoreImages<BR>
&lt;/SCRIPT&gt;<BR>
&nbsp;<BR>
|||||||This code will suffice for IExplorer - no other actions required|||||||||<BR>
In Explorer client case, this script will not allow to even click on the image. So, the context menu options like:<BR>
&nbsp;"save background as"; "set as background" &amp;&nbsp;"copy background", will only give the opportunity to save the <BR>
warning image since it will&nbsp; be switched immediately. <BR>
In Firefox/Navigator<BR>
This code will clear/replace all the background images with the copyright warning image in case the user<BR>
goes for: Tools/ Page Info ... Media Tab/Save As in Firefox or Navigator thanks to the Options Box receiving focus.<BR >Same will do in case the user goes for File /Save As ...complete page.<BR>
So far so good, but there is one last hole:<BR>
Firefox special Context Menu Option "View Background Image", is designed to act as a complete bitch.<BR>
This option will blow off all&nbsp;we have achieved in previous steps. Allowing user to navigate to a new page <BR>
containing the protected image caught offguard.<BR>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<BR>
!!!!&nbsp; Netscape/Firefox not solved !!!!<BR>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<BR>
Since mozillas event model has always been a week point, we are forced to use a non scripting solution for it.<BR>
Unclean workaround of displaying fully transparent gifs on top of these backgrounds. For now of course...<BR>
&nbsp;<BR>
THIRD STEP - JavaScript Disabled<BR>
(Denying javascript disabled browsers from viewing images unless they decide to enable it)<BR>
As we can see. We have another door OPEN: the script disabled client browser.<BR>
A hard coded HTML with a clear message like: "This page can not display properly with Javascript disabled, blla blla blla"<BR>
Should be used.&nbsp;Than you should decide how to make these images available to the browser render engine through script<BR>
You can&nbsp;decide for, either using css visibility/display or set background properties dynamically with javascript during runtime.<BR ><BR >THE SCREEN CAPTURE ISSUE - my last cent<BR>
Since almost all screen capture applications along with the "print screen" are invoked with&nbsp;a key stroke, we can use<BR>
key down event to call the clearRAM function just in time before the actual capture takes place. So there&nbsp;will be&nbsp;no <BR>
screen capturing either.<BR>
&nbsp;<BR>
&nbsp;<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Troy&nbsp;III<BR >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;progressive&nbsp;art&nbsp;enterprise<BR >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR ><BR ><BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_stopSpelling>
From: alaneaston666@hotmail.com<BR>To: javascript@LaTech.edu<BR>Date: Fri, 21 Jul 2006 09:58:26 +0100<BR>Subject: [Javascript] Disable left mouse click and drag on images<BR><BR>
<DIV>
<DIV class=EC_RTE>Hello People,</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>Now I know the issues surrounding trying to stop people stealing images off your website, it basically cannot be done, you can make life awkward, but essentially it cannot be done.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>Well, I have a client who wants me to make it as difficult as possible for any visitor trying to save their images.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>I have disabled right-click on images, but you can still left click on an image, and drag it to either the location bar, then save it once the image shows, or drag it to your desktop.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>Question is, does anyone have a trick that I can use to stop this "left-click and drag" on images....????</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>Any help would be appreciated.</DIV>
<DIV class=EC_RTE>&nbsp;</DIV>
<DIV class=EC_RTE>Alan...</DIV></DIV></BLOCKQUOTE><br /><hr />Express yourself instantly with  <a href='http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=joinmsncom/messenger' target='_new'>Windows Live Messenger</a></body>
</html>