diff options
author | SimonBrazell <simon@brazell.com.au> | 2020-06-03 22:01:27 +1000 |
---|---|---|
committer | SimonBrazell <simon@brazell.com.au> | 2020-06-03 22:01:27 +1000 |
commit | 3f015690992c8e0bd43c90e15a9aa88889defcc6 (patch) | |
tree | 4bc9ae83b0a132247109997889a7e8902d74604f /background.js | |
parent | Update store screenshots (diff) | |
download | libredirect-3f015690992c8e0bd43c90e15a9aa88889defcc6.zip |
Fix #60 & complete #30 - YT studio & Nitter "View on..." links
Diffstat (limited to 'background.js')
-rw-r--r-- | background.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/background.js b/background.js index c4783e3e..1a64639c 100644 --- a/background.js +++ b/background.js @@ -204,6 +204,10 @@ function redirectYouTube(url, initiator, type) { // Don't redirect YouTube Player API. return null; } + if (url.host.split('.')[0] === 'studio') { + // Avoid redirecting `studio.youtube.com` + return null; + } // Proxy video through the server if enabled by user if (alwaysProxy) { url.searchParams.append('local', true); @@ -224,6 +228,12 @@ function redirectTwitter(url, initiator) { if (disableNitter || isWhitelisted(initiator)) { return null; } + if (initiator && (initiator.origin === nitterInstance || twitterDomains.includes(initiator.host))) { + browser.storage.sync.set({ + redirectBypassFlag: true + }); + return null; + } if (url.host.split('.')[0] === 'pbs') { return `${nitterInstance}/pic/${encodeURIComponent(url.href)}`; } else if (url.host.split('.')[0] === 'video') { |