We’re big fans of iOS 8’s new Extensions framework, and a new Extension by developer Paul Hudson lets you view the source code for a webpage, right within Safari.
You could view source code of a webpage previously, but you needed a dedicated app, and had to open the page in that app. This extension lets you view the syntax highlighted source code (HTML, Javascript and CSS) without leaving Safari.
Here’s how you do it:
- Download and install View Source from this App Store link ($0.99).
- Open the app once, and then hop back to Safari.
- Open the webpage whose source you want to view in Safari.
- Tap on the Share button to bring up iOS 8’s Share sheet.
- The second row of icons contains Action Extensions. Scroll to the right of this row to reveal the More icon, and tap on it.
- You should see a list of available extensions, scroll to the View Source extension, and enable it by turning on the toggle.
- Now tap on the View Source icon.
- You should now see a new screen with the source code of the page.
- You can copy the source code to your clipboard or send it as an email.
This could be very useful to web developers who want to have a peek at the source code of their site, while they’re on the go.