mobile source code.pngMost mobile browsers are not geared towards doing developer-related things like viewing the source code of a page. There’s a nice bookmarklet, however, that will get you this functionality without too much trouble.

The Snoopy bookmarklet uses JavaScript to grab the source code of the page, and overlays it on the site you’re currently viewing. It will also provide you with other information such as doctype, character set, which popular JavaScript libraries it’s using (jQuery, jQuery UI, Prototype, and/or MooTools), and which analytics tools are on the page (Google, Reinvigorate, and/or Piwik).

To be honest this is an awesome little mobile tool, but you can also use it on a desktop browser. When viewing the source code of a page it scales to the width of the browser, and so it works equally well on a tiny mobile screen or a larger desktop screen.

When using it on my iPhone, however, there’s one thing you need to keep in mind. To scroll the content area you actually need to use two fingers due to the fact that Safari doesn’t put a scrollbar in the box. It’s hardly a deal killer, and as you can see in the screenshot there is a friendly reminder about this when you go to use it.

The only thing this is missing is syntax highlighting, which is apparently something the developer has on the todo list. I’m definitely looking forward to future updates on this bookmarklet. Note that the developer says that this won’t work on Android devices due to a browser limitation preventing JavaScript calls from the address bar.

Snoopy Bookmarklet Homepage