View the HTML source of any page with a quick tap, directly in Safari. Takes 30 seconds to install. No jailbreak required.
If you're using an iPad, you might want to make sure that Show Favourites Bar is toggled on under Safari in the Settings app.
- Add this (or any other) page as a bookmark, with e.g. View Source as name.
- Copy this chunk of code.*
- Open your bookmarks menu and navigate to the bookmark you added. Tap Edit, select your new bookmark, and make sure it is in the Favourites folder.
- Tap the Address field (which should contain something like
https://github.com/...
) and clear it. Paste the code you copied and tap Done or similar on your keyboard.
You can now view the source code of any web page using your new bookmark, which should be visible near the top of the screen on an iPad (if Show Favourites Bar is toggled on).
* Blindly copying and running code without understanding what it does or may do is generally a bad idea. If you don't trust this document, you should ask someone who knows programming for advice.
- Node.js with npm is required.
- If you are using Windows, you need to install and use Git Bash, Linux Subsystem or similar to be able to build.
git clone https://github.com/SimonAlling/view-source-for-ios
or download as ZIP.
In the root directory of this repo (i.e. view-source-for-ios/
), run
npm install
and wait for it to finish.
npm run build-production
to build with minification.
The script itself is written in TypeScript and the stylesheet in SASS.
These files are relevant for modifying View Source for iOS:
configuration.js
src/
Also, CONFIG_REQUIRED
in webpack.config.js
should be updated to match configuration.js
.