summaryrefslogtreecommitdiffstats
path: root/.config/qutebrowser/greasemonkey/fandom-to-breezewiki.js
blob: 59369f56c484583faec78e0539bbf5ad75918d7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.