Created
July 10, 2026 04:24
-
-
Save lostfictions/ec46034dd08c983942109ac65965705b to your computer and use it in GitHub Desktop.
Remove ref tags from outgoing Ghost blog links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Remove ref tags from outgoing Ghost blog links | |
| // @match https://readonlymemo.com/* | |
| // @match https://aftermath.site/* | |
| // @grant none | |
| // @run-at document-idle | |
| // ==/UserScript== | |
| const matcher = /[?&]ref=[^&#]+/i; | |
| for (const a of document.querySelectorAll('a[href]')) { | |
| const match = a.href?.match(matcher); | |
| if (match) { | |
| a.href = [...a.href].toSpliced(match.index, match[0].length).join(''); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment