[thelist] Protecting your code from viewing

Bruce Heerssen bruce at heerssen.com
Mon Nov 12 09:16:53 CST 2001

On Monday 12 November 2001 09:14, Bob Boisvert wrote:
> A while back I remember a thread being discussed about the possibility of
> hiding or protecting your code from being seen by viewing the source.
> I have come across a web site from a junk email I received that seems to
> have blocked the view source command in the windows right click pop up. 
> The message says:
> Sorry, that function is disabled. This page is copyrighted, images and text
> are protected. Or something to that affect.

This subject comes up from time to time. Scripts that do this are annoying at 
the least and may even damage the functionality of the site, and by 
extension, it's success.

1) Any developer worth his salt will not be stymied for a second. The is *no 
way* to hide source code. If you go to your menu bar and choose "view source" 
you'll get the code - even with javascript enabled. If you disable javascript 
you can view the source code by right-clicking - no problem. In any case, the 
code is in the browser's cache and can be viewed at any time.

2) This type of script interferes with many users favored method of 
navigation because the user can no longer choose 'back' or 'forward' from the 
right-click menu. 

3) Doing this insults the user, making the site less likely to generated 
return visits.

Basically, once something is downloaded to a user's computer - be it images, 
source code, or anything else - the user has it and can do anything he wants 
with it. Even Java and Flash can be decompiled if the user is sufficiently 
knowledgeable. There is simply no way to effectively guard against that. I 
liken it to trying to prevent print from being plagerized. 

-Bruce H.

More information about the thelist mailing list