htmlgoogle-chromemobilegoogle-chrome-devtoolsview-source

on desktop, how to view the source code of the mobile version of a website


I have created a website that displays different source code depending on whether the user is using a desktop or mobile device.

In Chrome on desktop, I can easily view the source code of the desktop version of any website simply by right-clicking anywhere on the website and then choosing "View Page Source".

In Chrome on desktop, is there a way that I can view the source code of the mobile version of a website? I know that in developer tools I can view websites using the mobile emulator, and I can inspect elements as rendered to the mobile browser. However, I have not yet figured out how to view the raw source code rendered to the mobile browser.


Solution

  • To view raw source of mobile version. From developer tools window, on Network tab, select request that retrieve page of interest.

    On right pane, activate Response tab. The original source is in Response payload window.