Is there a way to view the source HTML in the Android web browser?
alert method to return the source code, type this in the address bar:
In Firefox or Chrome on Android it's possible to view source by prefixing the URL in the address bar with "
view-source:", i.e. "
Look for an app called View Web Source in the market and install it.
Then when browsing, open your menu and tap "share", in the list that pops up choose View Web Source.
Another tool that is useful for viewing source AND modifying them live, in Firebug/Web Inspector-like manner, is the weinre remote debugger.
Create a new bookmark (bookmarklet) on Mobile Chrome with:
Name: View Source (vs)
Now when on a page, tap the address field and start typing: vs. The bookmarklet should appear, click it and you are ready.
If this is for debugging (from your comment it looks like it is) something even better is installing a user agent switcher extension for Firefox or Chrome on your desktop. Change the user agent to Android and you get the mobile version of the site, but with all the source and debugging tools you're used to.
you can capture the source to your shell or to a text file if you're using an emulator, which is very handy for development. To do this you'll need to install Android Developer Tools, which comes with adb. Fire up your emulator then from your OS's shell run the command:
adb logcat browser:V *:S
This will output everything within your html tag on the page to the log.
You can capture the output of your log (using BASH, at least, I can't speak to other shells) with:
adb logcat browser:V *:S > log.txt
now, any output from the log gets dumped into your log.txt file. This is really handy for a whole page's worth of HTML, as you can then search through it as you would any other text doc.
If you want to grab a specific bit of the page rather than the whole thing, you can specify that part of the page rather than the html tag in your JQuery, so if you need to look at a single div that has a class/id associated with it (for this example, it has a class named 'inspect-me'), you can change your JQuery to:
If you are using a Opera browser type this in your address bar, make sure you erase the http and other stuff, then type:
in the address of the page which you opened.
If you want to view source of Android browser page, or inspect page you can use this https://developer.chrome.com/devtools/docs/remote-debugging Its very good inspector