I saw How to hide html source & disable right click and text copy? . One of the answers say use ctrl+u to view the source. But, using shortcut.js I can override ctrl+u as well. How do I view source in that case.
9 Answers
You can't stop people. It will be passed over the network, and sniffable through Fiddler, or someone can use a text based browser, or disable Javascript entirely, or look through their cache folder for the files they downloaded from your site.
You cannot stop people from seeing your source.
Comments
Well it's not possible to prevent users from seeing your script. But what you can do is to make it mire harder that user quits trying after few common methods.
I recommend you to load an initial page. Then load the whole page by using ajax. You can show a friendly loading gif too. This technique has following adanages,
- browsers don't show generated HTML. Developers knw how to see this. But Normal user will not find it easily
- if any user just press Ctrl+u it'll show the initial page.
- wget, curl tool will not work at the first time.
- additionally you can obfuscate the main page (which you are going to load by Ajax).
wgetis always pretty easy too..