Page 1 of 1
disable view source ...
Posted: Mon Feb 14, 2005 6:45 pm
by HormonX
Does anyone know if there is a way to disable 'view source'? I don't mean getting rid of right-click option

.
Please let me know if there is a way of doing that.
Greg
Posted: Mon Feb 14, 2005 6:49 pm
by d3ad1ysp0rk
Short answer? It's impossible.
Long answer? ...Google.com has information on the long answer.
Posted: Mon Feb 14, 2005 8:24 pm
by feyd
technically, as long as a browser can display the page, the page's source can be seen and read. You can ~encrypt the data inside Javascript, but that only deters the casual person. Can we ask why you want to disallow viewing your source?
Posted: Tue Feb 15, 2005 6:43 pm
by myleow
because its not open source.

Posted: Wed Feb 16, 2005 5:55 pm
by rehfeld
well, you should realize that theres really nothing you can do to prevent it.
the average person prob couldnt get past a right click disabled or a javascript encrypting, but the average user prob has no care to read your html source either.
the person who would have a desire to read your source, can prob get around whatever you do fairly easily.
Posted: Thu Feb 17, 2005 3:04 am
by Maugrim_The_Reaper
This may be an odd question - but how is a project not being open source an encouragement to obscure html markup? I mean all your markup in the end is going to be standard HTML. Any decent author could replicate the display in their browser within a short time.
Posted: Thu Feb 17, 2005 10:38 am
by patrikG
and if I was really hell-bent on stealing your HTML I could use use get under Linux and there's nothing you could do against that.
Why would you be concerned about HTML? Javascript - I believe there are things like encoders for it, but that's as far as it goes. You have to live with the fact that whatever you put in front of the public's eyes, it'll be looked at.
Posted: Thu Feb 17, 2005 9:22 pm
by HormonX
well ... it was just curious if it was possible. As you guys mentioned nothing can be done to totaly hide the HTML code ... and there is no good reason for that as well.
thanx guys
Greg
Posted: Sat Feb 19, 2005 7:31 pm
by xudzh
THIS IS JUST AN IDEA:
1. create a file called dom.htm
2. In the page that the user would call, say index.htm, use window.open (make sure to somehow get pass the popup blocker) to open dom.htm.
3.have dom.htm first call window.opener.document.write() to erase the page source of index.htm . THEn use DOM functions to create ur original page, using createElement.(i forget the exact function name) then window.close();
Now when a user tries to view index.htm's page source, he/she will find it empty.
Posted: Sat Feb 19, 2005 7:37 pm
by feyd
the viewing will not be affected by Javascript.
Posted: Mon Feb 21, 2005 3:38 am
by CoderGoblin
If you try and hide code of any sort it often makes users more interested in what is going on and will encourage people to dig around, especially on a web site with technical people on it. Leave the HTML visible and people will generally ignore it. If you don't want javascript readable you can encode it with encoders but I read an article somewhere (cannot remember where unfortunately) which discussed these and the came up with the result that they are fairly easy to crack. The main reason for encoding the Javascript is to compress it for quicker download times.
Posted: Mon Feb 21, 2005 3:41 am
by patrikG
xudzh wrote:THIS IS JUST AN IDEA:
1. create a file called dom.htm
2. In the page that the user would call, say index.htm, use window.open (make sure to somehow get pass the popup blocker) to open dom.htm.
3.have dom.htm first call window.opener.document.write() to erase the page source of index.htm . THEn use DOM functions to create <span style='color:blue' title='ignorance is bliss'>your</span> original page, using createElement.(i forget the exact function name) then window.close();
Now when a user tries to view index.htm's page source, he/she will find it empty.
I disable Javascript with one click in my browser. And what if people have Javascript disabled by default?
Posted: Tue Feb 22, 2005 7:07 pm
by xudzh
It's just an idea i came up. Never really tried it.
