A bookmarklet to display the current page's HTML in a new tab. Supports HTML syntax highlighting and indentation, JavaScript keywords will be highlighted, too.
Before adding the bookmarklet, you need to either build view-source.js
, or copy view-source.min.js
to your clipboard, as we'll paste this into the bookmarklet later.
Safari apparently doesn't support adding a custom bookmarklet, so you'll need to follow these steps:
- Go to about:blank
- Share button
- Add to bookmarks
- Call it "View Source" or similar
- Go to your bookmarks and edit the previously created bookmark
- Paste the code into the URL
Important: You need to paste either the .min.js
contents or build it yourself. If the URL isn't prefixed with javascript:
, the bookmarklet won't work.