|
In IE, you can view the source of any file through either the context menu or tool bar. However, sometimes there are design reasons to disable or hide these. For example, you can prevent the content menu by putting this in the a script in the HTML body:
document.oncontextmenu=new Function("return false");
And you can hide toolbars by opening up a new window and passing in the appropriate options:
window.open(...);
However, even if a site does this, you can still view the source through the VS.Net debugger. Simply start debugging one of your own apps, then navigate to the target site in the address bar, and you'll see full source in the Script Explorer window.
Well you can do a lot of other things as well.
1) Grab the file from cache. It is downloaded and written there, it may
expire quickly but it is still there.
2) Write yourself a handy little .net control to do it. In the 2.0
framework the web browse control can be used to navigate to any url and you
can rip the source completely from there.
3) There are some older API's into IE where you can have an external
program control IE and rip through the DOM of downloaded page. I do not
remember all of them exactly but by using PInvoke on these older API's
there is one that just gives you the actual document as text. Sorry I can't
remember the API's exactly I would have to dig back through some very old
vb 6 code.
The following biterscripting commands will also show you the HTML source.