about summary refs log tree commit diff stats
path: root/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'background.js')
-rw-r--r--background.js10
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') {