Skip to content

Safari extension to view source of any web page, like in desktop browsers.

Notifications You must be signed in to change notification settings

SimonAlling/view-source-for-ios

Repository files navigation

View Source for iOS

View the HTML source of any page with a quick tap, directly in Safari. Takes 30 seconds to install. No jailbreak required.

Viewing source of Example.com

Table of Contents

  1. How to add to Safari
  2. Build from source
    1. Prerequisites
    2. Clone the repo
    3. Install dependencies
    4. Build
  3. Contribute
    1. Languages
    2. File structure

How to add to Safari

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.

  1. Add this (or any other) page as a bookmark, with e.g. View Source as name.
  2. Copy this chunk of code.*
  3. 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.
  4. 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.

Build from source

Prerequisites

Clone the repo

git clone https://github.com/SimonAlling/view-source-for-ios

or download as ZIP.

Install dependencies

In the root directory of this repo (i.e. view-source-for-ios/), run

npm install

and wait for it to finish.

Build

npm run build-production

to build with minification.

Contribute

Languages

The script itself is written in TypeScript and the stylesheet in SASS.

File structure

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.

About

Safari extension to view source of any web page, like in desktop browsers.

Resources

Stars

Watchers

Forks

Packages

No packages published