The trouble with this approach is that it doesn't work. There's no way to stop anyone from taking your images if they really want to, as the images are still sent out to the browser. Best thing in my experience to do is to watermark them and leave it at that.
As for stopping them from viewing the page source, if you disable the right click (which is easily disabled in browsers like Firefox) then they can click View / Page Source and still get access to it.
You could use a program like "html protector" to scramble your source code, but could effect search engine rankings for that page.
html source is generally not looked upon as "secret". PHP files or code-behind classes are already protected by the engines that output them. HTML however, is quite a basic language and generally people dont steal html from others (as its just presentation layer). Disabling the right mouse button will help, but as stated earler there really is no way to protect the html.
The down side is that people are prevented from using other right click functions such as opening a link in a new tab/window which actually keeps them on your site.
Images can be copied in seconds even if you have a no right click script. As a demonstration (with the owners permission) I once "stole" an image from a "protected" page and opened it in a graphics viewer. Opening the image took longer than acquiring it!
We might want to sticky one of the more productive threads that have already discussed this... can't remember the one I posted in, but:
Two things to think about, Wolflover:
1. There's no reason I can think of to protect pure HTML. There's nothing you've done in HTML that hasn't been done already, or couldn't be guessed at by an experienced designer. As someone else mentioned, programming pages like php would be a more noble thing to protect... HTML is too easy and too widespread for protection of it to make any sense. I'm sure most of us could guess what your HTML looks like just by viewing your site, no offense.
2. There are two kinds of people stealing your images: people who like your work and want to make it a pretty wallpaper on their computer(which does virtually no harm to you, and could even help promote your site), and people who want to illegally pass off your images as their own. The former group MIGHT be inexperienced enough to be thwarted by a "no right click" or "no source view" technique, but as I said, they're not the problem, so why piss off those people? The latter group- the image pirates- WILL get your image. There's nothing you can do about it. There are several very simple ways to get an image that don't even relate to right-clicking... I myself often prefer to take a screenshot instead of right-clicking, regardless of whether someone has attempted to protect it. You can't protect your images as it stands today.
The best way to keep your images safe is to make them look as bad as possible, as stupid as that sounds (and is). Make them very small, plaster your domain name over top of them, etc. You have to actually alter the image in question.
The others are right about HTML, there's no way (or reason) to "protect" it.
Regarding images, one commonly-used tactic is to use CSS to position a transparent .gif "over" the image you want to protect. People right-click what they think is your image, save it, and find they have this transparent .gif instead. However, this is a clumsy way to work, and is still only marginally effective. Anyone who knows the first thing about the web could get the image in just a few seconds. Even failing in that, there's always a screenshot, which you can't prevent.
Best thing to do about it is just get used to the idea that, as far as images go, people can get it if you put it on the web. By putting an image online, you give up all possible expectations of retaining control over how it is used or by whom. Of course there would always be the possibility of suing people who infringe on copyrights, but that's expensive and rarely pays off.
You can't stop screenshots so images can always be stolen.
But what I found once on a site where i was 'borrowing' an image myself was that they had cut the image into 10px blocks so the image itself was made out of 200 or so blocks. That did stop me from using right click to copy.
However this makes for so much extra code en trouble that it's not worth your effort either.
If it's a specific image someone could buy or use and harm you in the process (revenues) put a watermark on it, but other than that, there'snothing you can do.
|You can't stop screenshots so images can always be stolen |
Ya can't stop image theft, but you sure can stop screenshots:
<body oncontextmenu="return false">
This will fill the clip board so nothing else can be added. Rather a dirty trick though and will certainly piss off the user - but then again, that user just tried to steal from you :)
Note: this code is not standards compliant.
<body oncontextmenu="return false">
Just a note that this stops right-clicking but has no bearing upon the clipboard (as incorrectly stated above). It's also a very very annoying thing to do as the context menu is used for many tools other than copying your code.
Untick the box for 'disable or replace context menus'
Thanks for the correction vincevincevince.
>> Just a note that this stops right-clicking but
>> has no bearing upon the clipboard (as
>> incorrectly stated above).
And also certainly does nothing to prevent screenshots (as also is incorrectly stated above).
Geez - alright already.
I had originally posted both codes, then decided to remove the clipboard method but deleted the wrong explantion without checking.
Your pencils come without erasers do they?
As others have said, just don't think that it will absolutely prevent people from stealing images or viewing HTML source. But for those users who only know how to use the right click, it will work fine. Might be a small percentage, but what the heck.
Here's a good one:
The ability to swipe your images is only a PRT SCRN away.
>> I had originally posted both codes, then
>> decided to remove the clipboard method but
>> deleted the wrong explantion without checking.
Sorry, not meaning to ride you for a simple error, but at the same time we're trying to leave a thread containing accurate information. Followup posts making corrections shouldn't be taken personally, but while our pencils do come with erasers this thread doesn't -- so clear statements that earlier information was erroneous will be helpful to anyone who comes across this later.