just another exercise in futility.
Printable View
just another exercise in futility.
You can't protect your HTML source, and I don't see why you'd ever want to. Doing so would damage your search engine rankings, make it impossible for anyone without JavaScript to view your pages and increase both your development and page load times.
In order for browsers to work, they require the entire *unencrypted* HTML source (if you encrypt it using JavaScript, they have to be able to decrypt it). The web is built on open standards, use them to your advantage rather than trying to hide everything away (which you can't do anyway, and so you're just wasting your time).
You most certainly can gang, look here: http://www.popularshareware.com/HTML...load-5669.html ...and that's only a third party app....there are many ways to do it.
Is it because you don't want people to copy your stuff with copy/paste?
Wazz, you are a fool if you think it can be done. The browser has to read your html therefore there must be some way to decode that html. If it can be decoded, it can be accessed by someone who is sufficiently motivated. Besides which, your html is worth nothing. If you have something special about your design that you believe makes it worth something, there are other ways to protect your intellectual property. copyright, trademark, etc, etc, etc.
Alot of the time the html you all believe to be encoded can be found by simply doing a copy all from the browser window and pasting it into a simple development environment. Anything that they lock down via script (stopping copy/paste, accessing view source, etc) can be re-opened to the user via script or building your own app as well. If all else fails you simply build your own browser to grab it and save it in it's normal un-encoded form.....easy enough to do since there is source for a few browsers on the net.
As I said earlier, it is an exercise in futility.
Wazz, it is NOT possible to protect your HTML code from people who really want to read it. The only thing you can do is make it more difficult for newbies, with the downside of pages that will take longer to develop and load, because each page request will require some form of decryption.
I don't see why people are so paranoid about protecting their HTML anyway, it's very unlikely that what you're doing hasn't been done before, and chances are it's been posted on the web by some philanthropic webmaster who wants to share it with the Internet community.
I gotta agree with you on the Pwaring.
You'd have to be one paranoid person to be so worried about your HTML.
Why take all the time to protect it, as it will just slow your page from opening at it's maximum rate, and by the time that it does open then you've already lost a viewer..
GEEZ what's the world coming to when people are worried about there HTML being viewed...
Lfrog
To protect from theft of data and the "look" of the page, it is one extra step in protecting against image theft for example. And since the data is "non-transportable" it keeps users comeing back for reference which earns you money so no, it's not paranoia or futile, its a sensible (yet very annoying) thing to do.
The way I've always done it is to set frames, and use this little script...
<SCRIPT language=JavaScript1.1>
<!-- Begin
function right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { alert("Antitheft code by Donald S. Crothers ([email protected])"); return false; } return true; } document.onmousedown=right; if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right;
// End -->
</SCRIPT>
It's nowhere near perfect, but it should keep out most idiots on the web :P
Regards,
SSJVegeta-Sei
We all sure love to go off into theoreticals, including me... :D
In short, if the public can view your HTML web page, then a determined member of the public who comes across your web page will get able to get its source code.
But, you can make it a huge pain in the butt for that determined person to get the original HTML source.
A very simple/common thing people may do is disable right click. You can still go to view > page source and that is defeated.
The next way the HTML can be hidden is by obscufercating it. There are many HTML and ASCII equivilents, and some basic javascript functions can convert them into normal HTML before writing it to the screen. When you view source, you see a javascript that takes a really long line and displays it. The line usually contains stuff like %20, along with many %, &, and \ symbols, numbers, and letters. I think this can be defeated by changing the code around so that it displays the output of that as an alert, or by using other commonly avaialbe scripts to change those weird characters into normal HTML. I think most of them are easily defeated with the second method.
Also, implementation of the above script may not even need you to go into the source. In some cases, you can acturally decrypt the values straight from the address bar! This varies among how it was coded in, but if the encrypted value is stored in a variable (and you can even change the code so that it is) and the decrypting and display functions are different (that is important) then you can simply run the variable through the decrypting code and display the output.
I'll give an example here, and probably write up a tutorial on it later (RESERVED! :p)... In the address bar, type in "javascript:checklength(document.vbform);" What does this code do? It is the code under the "check message length" link inside of the post a quick reply box. Using something like can reveal the HTML if you know how to manipulate it just right, and if you recode parts to make it easier.
That is about all I can remember for hiding HTML that is public access...
Note I'm talking about public access. If this was private access where only you and your buddies had a secret password, then the above wouldn't apply if you had no checks for the passwords, and the password encrypts the HTML. Doing that, you would need another app to encrypt the HTML, and those can be written in HTML too. The problem is that you would need another script to do that thing...
Also, server side scripting lets the server run code, and you can have it require a password before displaying anything else. Of course it still produces HTML and that HTML can be viewed, but you can have a backend that they can't see that says "Here it is" or "Nope!". If it says "Nope!", then unless they get it so say "Here it is" (which they need a password to do) they won't be getting it...
As these thoughts run through, I feel I should write a Javascript tutorial... One of my favourite languages, learned before C/C++... HTML can be powerful! :D