Forum Moderators: phranque
What is the best code to stop casual copying of the page and images, and break any frames linkers try to put on our content?
I've been using this form successfully, but wonder if there's something better to cope with new browsers:
<script language="JavaScript" type="text/javascript">
<!--
function framebreakout()
{
if (top.location!= location) {
top.location.href = document.location.href ;
}
}
//-->
</script>
<meta http-equiv="imagetoolbar" content="no"></HEAD><BODY onload="framebreakout()" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
And in passing; does using this base ref on a page stop frames being put on it by sites who link to the page?
<BASE href="http://www.example.com/">
Ta
What's the best method to use to stop it?
Ta!
Things you can do that make things a tiny bit more difficult.
- check the referer. If it's not your site, don't serve up images
- create a honeypot to catch page scrapers
We both know how easily it is circumvented, but it certainly stops the IE bozos. I know, because I read their ALLCAPS rants :)
So we really need a better script than this...
if (top!= self) top.location.replace(self.location.href); You don't need an
onload event for this script. Of course, with the previously-discussed [webmasterworld.com] Yahoo images problem there is not a lot you can do client-side as Javascript is forcibly disabled (in IE only).
I blocked Y! images in robots.txt last week.