DEV Community

Cover image for How to view source code of a website on mobile device
Lucretius Biah
Lucretius Biah

Posted on • Edited on • Originally published at kudadam.com

9

How to view source code of a website on mobile device

Most of the times, when we visit a nice looking website, we always want to look at it's HTML source code. On desktop browsers, we simple just right-click and click on "view page source" from the context menu but there's no option like this on mobile devices. So then, how do we view the source code on a mobile device?

If we are to observe carefully, whenever we click on "view page source" on a desktop browser, it opens a new url in this format view-source:https://path/to/url.
If we apply this same trick on a mobile device, it works as expected.

Steps to view source code

  1. Visit the website which you want to view it's source code.
    A screenshot of Google's homepage

  2. Click inside the address bar and append view-source: before the url of the website.
    view source being highlighted

  3. Click the send button and the page will load with the source code of the file.
    Google's website

NB: Even though I used Chrome's mobile browser, the method is the same in all the major browsers.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (2)

Collapse
 
roman__907e3dbe2d21535fda profile image
Roman

Or simply use view-source.hellafast.digital

We method in the article doesn’t work on iOS or for Android users who don’t use Chrome. They are scarce, but there are some

Collapse
 
lubiah profile image
Lucretius Biah

Well, on Android, the about method works with:

  • Brave Browser
  • Opera Browser
  • Opera Mini Browser
  • Firefox Browser

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs