Would you please tell me how to disable right click to view source code of website?
Printable View
Would you please tell me how to disable right click to view source code of website?
Here how to do it in Internet Explorer:
http://www.winguides.com/registry/display.php/442/
If you are talking about how to do it on a clients computer, from a web page. Then the answer is, you cannot prevent the user from viewing the source code.
all they have to do is go to:
view-source:http://www.yoursite.com to get it. or they can use an application, essentially a browser which doesn't parse the code. (which can be made in about 3 minutes)
In IE that restriction will disable it completely. But then there is nothing stopping the user from downloading another web browser such as lynx and using that to dump the source in a text file.Quote:
Originally posted by Acidic
all they have to do is go to:
view-source:http://www.yoursite.com to get it. or they can use an application, essentially a browser which doesn't parse the code. (which can be made in about 3 minutes)
They can disable JavaScript. They can use wget (or a similar download app) to get the code. Mozilla 1.7 has a specific option to force enable the right-click menu.
Bottom Line: trying to hide your source from the user is pointless and annoying.
why do you want to block the source code? maybe we can find a workaround, obviously the best one would be to use a server side language.