I made a userscript that adds a "view source" button to posts! (it shows the original markdown source, not just the HTML on the page)
plaintext links just in case: view on github, download on greasyfork
Also, just for fun, here's an interactive demo of how it looks/works (slightly broken on dark mode, TODO):
0 comments
view source
<!-- good job! -->
hello world!
<div style="font-size:1.5em;">html</div>
> **markdown**
last update: 1.0.9 (2024/02/27)
compatibility info and changelog:
compatibility
| browser | userscript manager | works? | last tested version |
|---|---|---|---|
| firefox | tampermonkey | yes | |
| firefox | violentmonkey | yes | |
| firefox | greasemonkey | yes | |
| chrome | tampermonkey | yes | |
| safari | adguard | yes | 1.0.4 (thanks @LemmaEOF!) |
| safari | userscripts safari | yes | 1.0.9 (thanks @ticky!) |
| iOS | userscripts | yes1 | 1.0.7 |
other browsers & userscript managers will probably work fine, these are just the ones i've tested it on. If you've tried it on one that isn't listed, let me know!
(last tested version is listed for the ones that haven't been tested on the current version yet)
- sometimes toggling word wrap and hiding source view will stop working, idk why
changelog
1.0.9 (2024/02/27)
- fix display on cohost's dark theme (thanks to ldeaddr on github for contributing the fix)
1.0.8 (2023/01/02)
- fix on per-user tag pages (/username/tagged/tag)
1.0.7 (2022/12/01)
- added support for bookmarked tags feed (thanks to @AquamarinePlasma for letting me know it was broken)
- fixed word wrap toggle & closing source view on userscript managers that don't support
@run-at document-start
1.0.6 (2022/11/22)
- fixed no longer being able to show source for posts on second page and beyond of home
1.0.5 (2022/11/16)
- added
fullbetter support for userscript managers like userscripts on iOS which don't supportunsafeWindow
1.0.4 (2022/11/01)
- fixed no longer being able to show source when viewing a single post.
1.0.3 (2022/10/31)
- fixed no longer being able to show source when viewing posts on someone's profile.
1.0.2 (2022/10/10)
- fixed no longer being able to show source on posts that were shared without any added comment
1.0.1 (2022/08/06)
- fixed multiple compatibility issues with greasemonkey (thanks to @obspogon for pointing it out!)