Discussion Locked

Disabling View Source for Web Pages

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there a way to eliminate someone from viewing my web page's source code? I know there are a few ways with Java Script to disable the right click but then users could go to the menu, View and select code and get to the same spot. Microsoft and many other websites have now gotten to where you can right click and select view source but nothing happens and the back door through the menus doesn't work either. Thanks for your help, Jeremy

10 replies

by madestroitsolutions

I have seen what you are describing before, and I think it has to do with the web server settings. Im not sure how to achieve it though. What I DO NOW, is a stupid little trick that, believe it or not, works better than one would expect. Simply put a lot of spaces before the code (empty lines). When user opens the source, they will see what appears to be an empty document, although your code is still there, but way down. It fools more people than you would think, lol.

Good Luck!

by brian

I used to work on websites and I would have to imitate client sites. They frequently did things like this to hide their code. I generally managed to avoid asking for html and java. If you use ASP and some other languages that code cant be ripped out as easily.

by rrv

Just do your web in ASP.NET using your favourite language. It can be any one of 24 languages now. In this web is no more than a windows application development. You can enumerate any menu item in the window and disable or hide it even.

RV

by jeremy the it guy

Thanks for the tip but this isn't what I'm looking for. If you think that it is and you can prove it, email me at jwhitlock@starprecision.com Thanks, Jeremy

by jeremy the it guy

There seems to be a problem with some people misunderstanding my question. My question wasn't "How can I keep people from viewing my source code?" it's how do many websites online like Microsoft and MSN keep you from viewing the source code by right clicking and choosing "View Source" or going to the menu and going to "View" then "Source". I am sorry if the problem was my fault but I thought the question was pretty self explanatory. Thanks, Jeremy

by mmacd_2000

I can view the source for Microsoft's pages just fine. Same for MSN, except it's onebiglongstringofcodeandreallyhardtoread. But it's nothing unusual.

They DO have linked javascripts, and those don't show up directly. The URL for them does, and you can certainly grab that too if you really want.

Also, I'm pretty sure the pages are generated from server side scripts, and I DON'T see those -- just the HTML/js they generate.

One thing -- if you open a PDF in your browser, and then go toanother page and try to view source, it IS disabled. However, close that window and open a new one, and view source is fine.

by jeremy the it guy

It appears that the problem was with IE6 and I needed to clear the cache. That was why I couldn't view the source of those two pages along with many more. Thanks for the tip, J

This discussion is closed to new replies.