Add functions to bypass websites that are redirected to (looking at you voe)

This commit is contained in:
2022-07-13 00:45:52 +02:00
parent 672b920f31
commit 4cf76eb62a
9 changed files with 68 additions and 89 deletions

14
src/match/match.ts Normal file
View File

@ -0,0 +1,14 @@
import {Match, matches} from "./matches";
import {getAllDisabled, getDisabled} from "../store/store";
export async function getMatch(host: string): Promise<Match | undefined> {
if (await getAllDisabled()) {
return undefined
}
for (const match of matches) {
if (match.domains.some(v => host.indexOf(v) !== -1) && !((await getDisabled()).some(v => v === match))) {
return match
}
}
}