diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2021-10-29 20:55:16 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2021-10-29 20:55:16 +0700 |
commit | b0da859852cbe60a91d1db2e866abbbe35f404cc (patch) | |
tree | 83fb087c4b1a8f23ce68646a7eba7128dd6c9659 | |
parent | Remove default scribe instance (diff) | |
download | libredirect-b0da859852cbe60a91d1db2e866abbbe35f404cc.zip |
Detect setting change for scribe redirect
-rw-r--r-- | src/pages/background/background.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 3a8103df..741bf6a1 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -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 = { |