fix Violentmonkey --> .connect

This commit is contained in:
Gabe Yuan
2023-09-03 21:45:06 +08:00
parent 67d9e70b3c
commit 2c24214f48
2 changed files with 4 additions and 1 deletions

View File

@@ -83,7 +83,9 @@ const fetchApi = async ({ input, init = {}, translator, token }) => {
} else {
info = GM.info;
}
const connects = info?.script?.connects || [];
// Tampermonkey --> .connects
// Violentmonkey --> .connect
const connects = info?.script?.connects || info?.script?.connect || [];
const url = new URL(input);
const isSafe = connects.find((item) => url.hostname.endsWith(item));
if (isSafe) {