Detect setting change for scribe redirect
This commit is contained in:
parent
263626d7d1
commit
b0da859852
|
@ -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 = {
|
||||||
|
|
Loading…
Reference in New Issue