37 Votes

Show HTML Source Code in Mobile Android Browser

Info by Anja Proggy | Last update on 2023-01-29 | Created on 2014-06-11

As web developer, of course, I am constantly interested in the source code behind, when discovering and exciting website. And not only when sitting at the desktop computer at home!

Also when surfing the web on my smartphone, sometimes, I would like to have a look at the sources.

First, I thought, that this is not possible. I thought, the developers of the smartphone browsers are not providing any possibility to glance at the HTML. Of course, this would fit the current development making the user more and more unaware of the technical details, but I have nevertheless found some solutions. Here are the possibilities.

Firefox

For the mobile Android Firefox browser, there is the convenient extension "View Source Mobile" available. After you have installed this Add-On, the normally menu is extended by the entry "View Source". Here is the link to this Add-On.

Chrome

It is also possible to show the HTML source code using the mobile Chrome browser. Just add "view-source:" to the normal URL in the address bar. For example, "view-source:http://www.example.com" to show the HTML of "example.com". This trick is also working in Firefox, Syntax-Highlighting included.

JavaScript Solution

If you cannot use one of the other methods, you can just fall back to the Java Script solution:

javascript:alert(document.getElementsByTagName('html')[0].innerHTML);

When typing this into the address bar, the HTML code is shown.

If you should know other possibilities of showing the HTML, fell free to write a comment.

ReplyPositiveNegativeDateVotes
00 Votes

Thanks for the JavaScript code. If you make a bookmark out of it, you even save the work with typing. This is then called Bookmarklet.
2023-01-11 at 23:48

ReplyPositive Negative
00 Votes

The solution for Chrome also works for the default Samsung Browser. Thanks for the helpfull note.
2015-08-19 at 23:23

ReplyPositive Negative
Reply

About the Author

AvatarThe author has not added a profile short description yet.
Show Profile

 

Related Topics

Android Splash Screen Tutorial

Tutorial | 0 Comments

Android Getting Sound Levels

Open Question | 1 Answer

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.