From fb230dc8c2a5578ab92a475b641f1f72bdb9a891 Mon Sep 17 00:00:00 2001 From: PHO Date: Thu, 5 Mar 2020 01:37:33 +0900 Subject: [PATCH] initial commit --- imenu-relinker.user.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 imenu-relinker.user.js diff --git a/imenu-relinker.user.js b/imenu-relinker.user.js new file mode 100644 index 0000000..79c8fe0 --- /dev/null +++ b/imenu-relinker.user.js @@ -0,0 +1,25 @@ +// ==UserScript== +// @name ime.nu relinker +// @namespace http://cielonegro.org/ +// @description Fix links on 5ch.net BBS. +// @author PHO +// @version 1.0 +// @license CC0 +// @run-at document-idle +// @include https://*.5ch.net/* +// ==/UserScript== +(function () { + function relink_all() { + var anchors = document.getElementsByTagName("a"); + for (var i = 0; i < anchors.length; i++) { + var href = anchors[i].href; + + /* http://jump.5ch.net/? */ + href = href.replace(/^http:\/\/jump\.5ch\.net\/\?/, ""); + + anchors[i].href = href; + } + } + + relink_all(); +})(); -- 2.40.0