Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: incrediBILL
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.
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!
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.
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.
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
<body oncontextmenu="return false">
Note: this code is not standards compliant.
<body oncontextmenu="return false">
Untick the box for 'disable or replace context menus'
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:
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.