View Full Version : help with source

08-08-2002, 08:09 PM
I want that poeple should not go to the source and view it,how can i stop people from stop viewing it,i a way to disable source under edit menu.

08-08-2002, 08:15 PM


08-08-2002, 08:25 PM
JavaScript has never kept me from Viewing a source....

All i do is go up to file and save the page to my destop then i open it with notepad....

Just thought id warn ya if you didnt already know that

08-08-2002, 08:35 PM
All I have to do is go to http://validator.w3.org and type in the URL. Then, click Show Source. Pretty simple, huh? :D

Even if there became a way to fully protect source while browsing the site, people can always get your source by using other websites (example above)

08-13-2002, 07:03 AM
I have never in my life read the exact same question so many times before....

08-13-2002, 05:50 PM
Yeah, I have the same feeling.

I would think that every web builder would understand by now that it's impossible to hide source. These topics are really getting monotonous (hope I spelled that right :o )

Roy Sinclair
08-13-2002, 07:57 PM
Originally posted by jscript_junkie
Yeah, I have the same feeling.

I would think that every web builder would understand by now that it's impossible to hide source. These topics are really getting monotonous (hope I spelled that right :o )

It would be nice if we could get new people coming in here to perform even a single search for the answer to a question before asking it again. It could save them a tremendous amount of time but it obvious that the possibility of finding the answer already present in the forum rarely crosses their mind. Of course, those who do such a search rarely need to post so we usually see only those who fail to search :( .

08-13-2002, 08:00 PM
I hear you Roy ;),

One other possible solution is to comply a FAQ list and make it a sticky thread for each forum....

08-13-2002, 08:00 PM
Maybe they could create a sticky post saying, "It's impossible to hide your source" :D

Then just have the discussion there. That would be a cool solution. :thumbsup:

<edit my="post" />
Wow, that's funny. The same idea at the same time. How weird... :D

08-16-2002, 10:40 AM
yeah i know that the source is not meant to be hidden,thanx to all of u for givin me the vision..ehehe:D

08-23-2002, 03:01 PM
Hey, Shweta_ilike, don't give up so fast. I'm no expert but I know there are many reasons (some REALLY GOOD reasons too!) why someone might want to hide their code. But hey, I'm tired right now and I don't feel like listing them.

And for all you "experts" out there saying it can't (or shouldn't) be done, are you trying to distract us away from your little secret so that you can keep it all to yourselves?!!

For instance, how bout this cute little website that somehow has accomplished nullifying the view source in the right-click context menu and blanking out the view source box when you call it from the top menu (EVEN after javascript is TURNED OFF): http://pub41.ezboard.com/bbigwolfsterritory

How'd he do that???!!!! Or is my browser messed up, or am I missing something (well, I'm a newbie so I'm always missing something I'm sure)?

I know I know... you can still "Save As" from the File menu, and then diddle with it. But it's still a pretty nifty trick that will dissuade 80-90% of the viewing public who snip codes for themselves (which, by the way, i'll confess, includes myself).

If you can explain how Big Wolf did this, I'm sure Shweta_ilike (AND myself) would be tremendously appreciative.

Also, for your "hardcore" code protection purposes, what do you guys think about this:


08-23-2002, 04:44 PM
tired&lonely, the bottom line is that the source code for any page is on the client machine somewhere. That's how HTTP works. A browser makes a request for a document from a web server and the web server sends the document data back. That's it, the user now has your data. It's really just a fancy file server.

You can try using JavaScript tricks to disable the context menu or open pages in new windows with no menu bar, but that only keeps the user from seeing the source with their browser.

The source in the example you gave at http://pub41.ezboard.com/bbigwolfsterritory can be viewed just fine in a Mozilla browser, probably others as well.

The copyseal.com site doesn't even offer an example (that I could find). But they do admit that their technique is not fool-proof:

"A weak spot in the technology is that it corrupts rather than destroys the text that can be printed off the Web, making it possible to read a document if the reader is extremely patient. Kerr dismisses this, saying that 90% of people would not be prepared to spend the time reading corrupted text."

- taken from http://copyseal.com.au/common/content.asp?CONTENT=446

Obfuscating or encrypting the source doesn't guarantee anything either. You can search the forums for examples of other companies that try these things and see how easily they are circumvented.

08-23-2002, 08:32 PM
You can use all of the encryption, blocking, and even if you could disable everything in the browser, your source isn't safe.

It would be safe when the user is browsing the page protected, but just see the bottom of my sig. I can get anybody's source by using other web services (The W3C Validation Service, in my example.)

In three words: Source isn't safe :)

08-23-2002, 11:39 PM
OK OK. It seems like you guys are completely missing the point. OF COURSE, no code is ever completely unbreakable, no matter how many tricks you try using to hide it. We get it, we get it.... "NO SOURCE IS SAFE". After all the times people ask how to hide their source, and then your standard comeback is "no trick can fool us if WE really want to get at your code". Like "DUH!"... isn't this a forum where code-cracking webmasters like yourselves tend to hang?!! (But note: the capitalized "WE")

I guess someone here needs to rephrase the question as a challenge to you: In your expert opinion, (beyond disabling right click) what is the very best way that YOU know of to hide source code from your (please note I'm qualifying this-> ) TYPICAL unsophisticated code-snipping-but-never-going-to-be-an-expert-code-cracking amateur webdesigner, which (surprise surprise!) happens to be 80-90% of your webdesigning public? "Fool-proof" techniques (in the LITERAL sense) I guess would be another way of re-wording it.

So, if any pros here can keep two conflicting ideas in their head at the same time, your proffered ideas might make up an interesting compendium of "DISSUADE code stealing" techniques.

08-24-2002, 04:09 AM
On my index page, I had a window.close() onload event in the BODY tag. When presented with the option to close, I had an onclick event that would try to close the browser. If they clicked on "No" it would present the question again because their click triggered a window.close() event.

Then, when they finally clicked on "Yes" I had an onunload function call a chromeless window (regular windows display the url for a brief moment, just print screen and you get the URL. Chromeless windows display the title only.) I didn't use a script for blocking right click, but an oncontextmenu.

I found that through scripting, I could disable the Control & N combination to open a new window. But, if the user knows how to disable JavaScript, source will fail there.

For the average user who just knows how to surf, this would be considered "fool-proof". One question you have to ask yourself is: Are my visitors going to go through all of that just to see the page (if they can even access it??)

I was like this way once, but once I found out about the W3C Validation service, I knew of a way for people to get my source. Now, I concentrate on having my pages look nice in the newest browsers, but degrade nicely with older browsers.

You have to choose one of the two paths: Build for a few users for "potentially" protected code or for all users to access freely. I'm currently on the second path. 5 stars for this thread!!! :D :thumbsup: :cool:

08-24-2002, 08:53 AM
Hello there,thanx for that,yes i know about chromless window,but i opt for the 2nd path too now,working to make my page accessible n appealing to masses.......coz there r many ways to view the source,i myself have learned a lot viewing the sources of some good pages.....anyway,i'm so glad u like my sticky thread:o ,:D

08-24-2002, 03:13 PM
Wow. Now I feel like I've done my job. Ever since I found out about the W3C method to view source, I started a mission to tell everybody about how source is unprotectable.

I finally feel like I've done my purpose. Now if everybody else could do the same... :D