Viewing HTML Source Code On iPhone and iPad
As a new software engineering student I noticed a limitation when trying to test out my webpages on either my iPhone or iPad, there is no built in functionality to "view source page source". Sure, there are third party apps that do this plus much more but I just wanted a built in option right in my Safari mobile browser.
With a little googling I found there is a way and it starts with an app that every Apple device has called Shortcuts. You can use this app to build custom shortcuts that can be added to your browser actions. You can do a lot more with the Shortcuts app. (The gifs in this post were created using a shortcut!)
Once there hit the + in the top right corner to add a new shortcut. You can set the name, icon and icon color.
Then it is time to "Add Action" and search for and choose "Make HTML from Rich Text". Click the settings icon in the upper right and turn on "Show in Share Sheet". Add another action, search and choose "Quick Look".
All that is left to do now is test it out. Go to any webpage in Safari and hit the action button, then choose "View Source" and Voilà, source code!
Website Genuine Page Speed, Core Web Vitals Expert at No Any Company
3 周I have developed an utility to view page source of any web page in mobile or similar devices. Mt View Page Source utility is robust and simple: https://agalaxycode.blogspot.com/2025/03/view-page-source-in-mobile.html
System Specialist 2nd
5 个月This is superb! Thank you ????
Front-End Web Developer Specializing in React, JavaScript, PHP, & WordPress
8 个月Awesome thank you! Here is a video showing how I did it on my phone in what I think is the new ios: https://youtu.be/K5fHWlgnFXQ
Professor at Université C?te d'Azur, CNRS, Inria, LJAD
1 年Jay Setlock???????? excellent: very useful, many thanks. nb: do not choose "make full document"
Small Business Owner | Knowledge Seeker & Avid Learner | All Things Business |
1 年Thank you! I could’ve sworn I used to be able to view source via my phone, but I guess not ??♀?