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