I thought there'd be an easy way to do this, but I may have been wrong.
How can I view the source for a web page using Safari browser on an iPhone?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
You don’t need an app to inject a view source share option.
Create a bookmark in mobile Safari and then edit it to include
When you are on a page and select this “bookmark” it transforms the page and opens up a new tab with most (anything inside
<body>) of the source code from the current web page.
Mobile Safari can call other programs to "View Source" via the share functionality in iOS / iPadOS.
And for current webpage one can see:
Apple’s native solution is Safari Web Inspector. Currently all developer tools for iOS do still run on macOS so get out your mac and dive in if you want a first party solution.
Here’s a 5 minute tech talk, but the developer site has hours and pages of content depending on what you are going to do with this.
To enable on the iPhone - use the setting app, Safari, Advanced