summaryrefslogtreecommitdiffstats
path: root/.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-10-08 12:40:19 +0200
committerRomain Gonçalves <me@rgoncalves.se>2022-10-08 12:40:19 +0200
commitce6be946d024aa55a15d576388d05f90be671cf2 (patch)
treefa1053446a3fb06daee8438c1ff664cb36c0abcb /.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js
parent703ed1915c69911a95cab6e1fb6524629c976800 (diff)
downloaddots-ce6be946d024aa55a15d576388d05f90be671cf2.tar.gz
Sat Oct 8 12:40:19 PM CEST 2022
Diffstat (limited to '.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js')
-rwxr-xr-x.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js b/.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js
new file mode 100755
index 0000000..59369f5
--- /dev/null
+++ b/.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js
@@ -0,0 +1,21 @@
+// ==UserScript==
+// @name fandom to breezewiki
+// @match *://*.fandom.com/*
+// @grant none
+// @run-at document-start
+// ==/UserScript==
+
+BREEZEWIKI_INSTANCE = "breezewiki.pussthecat.org"
+
+url = location.href
+url = url.replace(/\bwww\.\b/, "")
+host = location.hostname
+path = location.pathname
+if (url.includes("/wiki/")) {
+ // this is bad
+ location.href = "https://" + BREEZEWIKI_INSTANCE + "/" + host.split(".")[0] + path
+}
+else {
+ url = url.replace("fandom.com", BREEZEWIKI_ISNTANCE)
+ location.href = url
+}
remember that computers suck.