diff options
Diffstat (limited to '.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js')
-rwxr-xr-x | .config/qutebrowser/greasemonkey/fandom-to-breezewiki.js | 21 |
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 +} |