View Current Page Source

View Current Page Source

Likes 81 Downloads
Get Shortcut
Security Notice
Shortcuts can be dangerous and may contain malicious code. Always exercise caution when downloading shortcuts. Review the shortcut's actions before running it and watch out for weird permission requests.

Description

This shortcut displays the current state of a web page's HTML source with syntax highlighting. It must be run from the share sheet of Safari. The source shown reflects the current DOM, including any changes made by JavaScript. Version 1.0 functioned reliably from iOS 13 through 18.3.2. However, iOS 18.4 introduced a bug (FB17129679) that delays script execution by over 10 seconds. Version 2.0 works around this issue and introduces several improvements. Version 2.1 added Prism's "Show Invisibles" plugin, which makes spaces, tabs and line breaks visible. It also makes the "Line Numbers" and "Show Invisibles" plugins optional. Version 2.2 supports pages without explicit doctypes, and the performance is improved, including disabling "Show Invisibles" automatically if the page is too large. Features • Syntax highlighting powered by Prism • No network requests — uses the page already loaded in Safari • Supports light and dark mode • Displays line numbers • Converts absolute URLs into clickable links • Includes a workaround for the iOS 18.4 execution delay bug (FB17129679) First published in Reddit in November 2018 (iOS 13!) Thanks to users @demon2758 (r/shortcuts' Discord) and @gluebyte for finding the bug and the workaround, as well as doing research on it.

Screenshots

View Current Page Source - Screenshot 1

Information

Version: 2.2
Released:
Last Updated:
Permissions:
Files

Comments

1 comment

K
Keen 1 year ago
Well made. Will be using.