Click to See Complete Forum and Search --> : Disable "View Source"


Charville
05-14-2003, 08:39 PM
How can I add a code to my pages so that the viewer isn't able to right click and View Source for a web page? I read it somewhere but forget... Thankx

pyro
05-14-2003, 09:08 PM
You can disable right click with something like:

<script language="javascript" type="text/javascript">
document.oncontextmenu = IE; //IE
if (!document.all) { //NN & Mozilla
document.captureEvents(Event.MOUSEDOWN);document.onclick = NN;
}

function IE() { //IE
if (document.all) {
return false;
}
}

function NN(e) { //NN & Mozilla
if (e.which==2||e.which==3) {
return false;
}
}

But, that is not disabling View Source. There is no way to protect your source, as there are many easy ways for one to get it...

Charville
05-14-2003, 09:13 PM
Wow - that was a quick response. Thanks. I see a lot of my graphics around other sites in town. Someone likes to right click.

pyro
05-14-2003, 09:21 PM
A no-rightclick script is not going to stop people from taking your graphics. Here are a few other ways they could do it:

File > Save As (to save the page -- including graphics)
Get the page from their Temporary Internet Folder
Use a screen capture program or the Windows Print Screen
etc...

Your best bet is going to be to add a watermark to your images, so people at least know where they came from...

PeOfEo
05-14-2003, 09:22 PM
hmmm, wouldnt all your codes for ns be like exactly the same for mozilla? Since netscape and mozilla are almost carbon copyies

PeOfEo
05-14-2003, 09:24 PM
oh nevermind, you were just putting those 2 separate because they will be recognised separatly instelad of just saying one or the other. What about opera being recognised as opera and not ie

pyro
05-14-2003, 09:28 PM
The script does not work for Opera browsers...Nor does any other no-rightclick script that I've seen.

Charville
05-14-2003, 09:30 PM
Okay - dummy here - how to add a watermark? I use Fireworks or Illustrator for most of my graphics...

pyro
05-14-2003, 09:31 PM
Just add a new layer, and add some semi-transparent text. Perhaps a link to your site. Usually on the lower-right corner. If you need to know how to do this in Fireworks, I can explain...

Charville
05-14-2003, 09:32 PM
Thanks for the tip...didn't realize you could do that - slow on the uptake here...

havik
05-15-2003, 12:22 AM
The script does not work for Opera browsers...Nor does any other no-rightclick script that I've seen.

I'd be curious to know if this is currently unavailable with Opera or if anyone has given it serious thought. I'll do some research and find out.

Havik

Nevermore
05-15-2003, 01:09 AM
If you own the copyright on the images, and you are worried about intellectual property theft, then you might want to look into digital watermarking. This basically consists of embedding a small, invisible 'tracking bug' into each of your images. A bot, similiar to a search engine spider, will then scour the web and report back on anywhere that it finds your images. This will allow you to warn people off or file court action. Of course, just disabling right click, watermarking and displaying copyright notes will warn most off.
BTW, most property protection companies recommend puttting watermarks through the center, and large. This is to stop them being removed very easily.

Charville
05-15-2003, 02:14 AM
Okay - so I add a watermark to my graphics...silly question, but then the watermark would show up on the web pages I put them on, wouldn't they? Also, how do I add a copyright note to the graphic?

dumb de dumb dumb...

pyro
05-15-2003, 07:59 AM
Yes, your watermark will show up on your graphics. To add a copyright notice, I would just add something like &copy; 2003 http://www.yourdomain.com

Nevermore
05-15-2003, 11:00 AM
I believe you are also obliged to add the name of the copyright holder.

Charville
05-15-2003, 11:25 AM
Thank you to all that have helped me with this. I really appreciate it. Carry on...