How to View the Page Source of a Website on a Phone

How to View the Page Source of a Website on a Phone

By Kolade Chris | Tue Dec 20 2022 | Guide

Indeed, you can view the page source of a website on your mobile phone – be it Android, iPhone, or any other type of mobile phone.

But let me tell you how I stumbled on that feature. I discovered the "lang" attribute was not showing on my website (this website) – a bad thing for accessibility. So I added it and quickly wanted to see how it looks.

However, my laptop was already overworked for the day. So I decided to view it on my phone. But how? That’s what I'm going to show you in this article.

How to View the Page Source of a Website on your Phone

If you've ever viewed the page source of a website on a phone, there's probably something you haven’t noticed – whenever you right-click and select "View page source", "view-source:" is always prepend to the URL of the website.

So, if you view the page source of this website, look in the address bar and you should see something like:

view-source:https://www.koladechris.com

ss1.png

And if you view the page source of freeCodeCamp.org, the URL becomes:

view-source:https://www.freecodecamp.org

ss2.png

Since this is just an address bar, you can attach "view-source:" to the front of a website address and you'll be able to see the page source.

I did that on my phone with Chrome mobile and this is what happened:

ezgif-2-13c27ce807.gif

If it happens all the codes of the page source are in one line, check line-wrap: Screenshot_20221220-143559.png

This feature is not peculiar to Chrome, it should work on any other browser. This is how it looks on Firefox mobile:

Screenshot_20221220-143154.png

And this is how it looks on Edge mobile:

Screenshot_20221220-143451.png

The way both Edge and Chrome mobile displays it is almost the same thing. Maybe it's because they're both Chromium-based browsers.

Wrapping Up

That’s how you can view the page source of any website on your mobile phone. Thank you for reading. If you find this article helpful, don’t hesitate to share it with friends and family.