diff options
| author | chers <admin@tilde.tailb619f6.ts.net> | 2026-07-31 09:18:39 +0000 |
|---|---|---|
| committer | chers <admin@tilde.tailb619f6.ts.net> | 2026-07-31 09:18:39 +0000 |
| commit | 7023e4c7c8f158df78b5e71ddc2640290409eca1 (patch) | |
| tree | 077fb46bdb484bbbf7f9a81fd1d512f66650be10 /static/userscripts/localjump.user.js | |
Diffstat (limited to 'static/userscripts/localjump.user.js')
| -rw-r--r-- | static/userscripts/localjump.user.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/static/userscripts/localjump.user.js b/static/userscripts/localjump.user.js new file mode 100644 index 0000000..8c6274e --- /dev/null +++ b/static/userscripts/localjump.user.js @@ -0,0 +1,17 @@ +// ==UserScript== +// @name localjump +// @author Anon +// @namespace http://textboard.org +// @description Change single post quote links inside full thread views from separate single post views to local scroll jumps within the thread +// @version 1 +// @match *://textboard.org/* +// @grant none +// ==/UserScript== +(function() { + 'use strict'; + Array.from (document.getElementsByTagName ("a")).filter (e => e.hasAttribute ("href")).forEach (e => { + var h = e.getAttribute ("href") + var s = h.replace (/^\/([^\/]+)\/(\d+)\/(\d+)$/, "/$1/$2#t$2p$3") + if (h != s) { e.setAttribute ("href", s); } +}) +})(); |
