admin管理员组

文章数量:1277335

We have an option of disabling the right click event on the HTML page at same user can click on view menu > source and can get a copy of the content displayed. How do i make it into unreadable format? Just like when you do a google search and see the source of page very similar to it? How can this be done?

We have an option of disabling the right click event on the HTML page at same user can click on view menu > source and can get a copy of the content displayed. How do i make it into unreadable format? Just like when you do a google search and see the source of page very similar to it? How can this be done?

Share Improve this question asked Jun 20, 2012 at 6:20 SantoshSantosh 8855 gold badges14 silver badges33 bronze badges 3
  • 4 Google is just minified. You can always view the source and generated HTML with tools like Developer Tools / Firebug. It's designed to be open. – Christian Commented Jun 20, 2012 at 6:26
  • 7 Don't annoy users by disabling their browser functions. It's pointless to do it. – DA. Commented Jun 20, 2012 at 6:28
  • You shouldn't go for it. I've seen several sites forbidding right clicks on the document to make the context dialogue unavailable and other horrible ideas. Just don't hide important data inside of your HTML or JavaScript code. – Sammy S. Commented Jun 20, 2012 at 6:30
Add a ment  | 

3 Answers 3

Reset to default 9

You can't. You can obfuscate the scripting and minify the html (remove all unnecesary whitespace) that's what google does). So, making the readability of the html (by obfuscation, minification) more difficult is the best option (if you must).

You can also go flash ofcourse, like in this website

How do i make it into unreadable format? well you can't change the format, its plaintext, this is how the browser expects AFAIK, when gmail first came out, its source code was sort of hidden, what they did actually is have the entire source of the page rendered using hidden iframes and JS, as such users would right click and get <!DOCTYPE html><html><head></head><body><div></div></body></html> but this is no longer the case.

how does Gmail hide its source

Try to press the code using this site http://www.textfixer./html/press-html-pression.php

It will remove all the whitespace and press the code to make it unreadable.

本文标签: javascriptHow to make the HTML page view source UNREADABLEStack Overflow