Detect setting change for scribe redirect

This commit is contained in:
Ngô Ngọc Đức Huy 2021-10-29 20:55:16 +07:00
parent 263626d7d1
commit b0da859852
No known key found for this signature in database
GPG Key ID: 904AF1C7CDF695C3
1 changed files with 4 additions and 4 deletions

View File

@ -193,6 +193,9 @@ browser.storage.onChanged.addListener((changes) => {
if ("disableNitter" in changes) { if ("disableNitter" in changes) {
disableNitter = changes.disableNitter.newValue; disableNitter = changes.disableNitter.newValue;
} }
if ("disableScribe" in changes) {
disableScribe = changes.disableScribe.newValue;
}
if ("disableInvidious" in changes) { if ("disableInvidious" in changes) {
disableInvidious = changes.disableInvidious.newValue; disableInvidious = changes.disableInvidious.newValue;
} }
@ -540,9 +543,6 @@ function redirectMedium(url, initiator) {
if (disableScribe || isException(url, initiator)) { if (disableScribe || isException(url, initiator)) {
return null; return null;
} }
if (url.pathname.split("/").includes("home")) {
return null;
}
if ( if (
isFirefox() && isFirefox() &&
initiator && initiator &&
@ -654,7 +654,7 @@ browser.webRequest.onBeforeRequest.addListener(
}; };
} else if (mediumDomains.includes(url.host)) { } else if (mediumDomains.includes(url.host)) {
redirect = { redirect = {
redirectUrl: redirectMedium(url, initiator, details.type), redirectUrl: redirectMedium(url, initiator),
}; };
} else if (url.href.match(googleSearchRegex)) { } else if (url.href.match(googleSearchRegex)) {
redirect = { redirect = {