]> gitweb @ CieloNegro.org - imenu-relinker.git/commitdiff
initial commit
authorPHO <pho@cielonegro.org>
Wed, 4 Mar 2020 16:37:33 +0000 (01:37 +0900)
committerPHO <pho@cielonegro.org>
Wed, 4 Mar 2020 16:37:33 +0000 (01:37 +0900)
imenu-relinker.user.js [new file with mode: 0644]

diff --git a/imenu-relinker.user.js b/imenu-relinker.user.js
new file mode 100644 (file)
index 0000000..79c8fe0
--- /dev/null
@@ -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();
+})();