View Web Page's HTML Source

Are you web-curious and want to take a peek at the source code of any website on the internet? If so, you are not alone. How to view HTML source codes from ANY webpage on an iPhone (or another iDevice–iPad or iPod Touch.) Please follow instructions exactly from your iPad or iPhone

Mobirise

Step 1

Tap Safari (iPhone, iPod, or iPad), if it is not already open, and visit this page. This method also works for Chrome

Step 2

Select the Share Button (also known as the Action button):

Step 3

Tap Bookmark:

Step 4

Choose the Name Field and hit the X icon to clear it and name it “Show Page Source” and then tap “Save.”

Step 5

Now visit this page and select all and copy the javascript code: (code credit: Rob Flaherty)

Step 6

Confirm that the code you copy from Rob’s site looks the same as this (but copy from this page NOT from below):
javascript:(function(){var a=window.open(‘about:blank’).document;a.write(‘’);a.close();var b=a.body.appendChild(a.createElement(‘pre’));b.style.overflow=’auto’;b.style.whiteSpace=’pre-wrap’;b.appendChild(a.createTextNode(document.documentElement.innerHTML))})();

Step 7

Tap the Bookmarks icon and tap Edit:

Step 8

Select the “Show Page Source” bookmark you just created in step # 4:

Step 9

Tap the Address Field and hit the X icon to clear it, then paste the javascript code you copied in step # 5; then tap Done


That’s it! Now you can use go to any webpage using mobile Safari (and Chrome) on your iDevice (iPhone, iPod, or iPad), tap the Bookmarks icon then tap the Show Page Source bookmark, and a new window opens displaying the source code of the webpage. Awesome and Easy!

Designed with Mobirise - See here