index

the sinister potion

antidisciplinary fun haver, cartoon mad scientist, objectpilled surrealist, universal collector, lover of perversion, spiritually nullo

art @unrealward


amgg
@amgg

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)

view on github download on greasyfork

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):

hello world!

html

markdown

0 comments
view source
wrap text
good job! (in the userscript this button will actually work)
<!-- 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

browseruserscript managerworks?last tested version
firefoxtampermonkeyyes
firefoxviolentmonkeyyes
firefoxgreasemonkeyyes
chrometampermonkeyyes
safariadguardyes1.0.4 (thanks @LemmaEOF!)
safariuserscripts safariyes1.0.9 (thanks @ticky!)
iOSuserscriptsyes11.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)

  1. 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 full better support for userscript managers like userscripts on iOS which don't support unsafeWindow

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!)

You must log in to comment.

in reply to @amgg's post:

tested it on there and I'm seeing the same thing.

the match parse error itself has a simple fix, but there's some other parts of the script that also aren't working on greasemonkey so I'll need to fix those as well.

Pinned Tags