Two Laptop Bag
The moose likes HTML, CSS and JavaScript and the fly likes How to Disbale ViewSource and SaveAs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to Disbale ViewSource and SaveAs" Watch "How to Disbale ViewSource and SaveAs" New topic

How to Disbale ViewSource and SaveAs

Mike Jeya
Ranch Hand

Joined: Apr 15, 2004
Posts: 54
I saw some webpage have disabled the "Source" option under the "View" menu item on the menu bar

I already disable the right mouse clicking on my webpage by using JavaScript. I want to know how to disable the view source select from the menu bar as well.
Sandip Sarkar
Ranch Hand

Joined: Nov 25, 2007
Posts: 55

I did some google on your issue and what i got to know is quite logical. The server has to send the data to the client and hence will be available in some readable format. You cannot do this through javascript.
As we know, javascript cannot access anything outside the web page. However there may be an ActiveX control that can do it for you. But still that too can be disabled.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
It can not be done. If it could be done, do you think Google, Hotmail, Yahoo, etc would let you look at their code?

I agree. Here's the link:
subject: How to Disbale ViewSource and SaveAs
It's not a secret anymore!