diff --git a/firefox-src/background.js b/firefox-src/background.js index d4162be..5ddef4a 100644 --- a/firefox-src/background.js +++ b/firefox-src/background.js @@ -427,9 +427,22 @@ function updateRules(parameterRedirectServices, customInstances) { } if (parameterRedirectServices.youtube) { - redirectRules.push( - createRedirectRule(1, "youtube.com", randYoutubeInstance) - ); + redirectRules.push({ + id: 1, + priority: 1, + condition: { + urlFilter: "||youtube.com", + resourceTypes: ["main_frame"], + excludedInitiatorDomains: [randYoutubeInstance], + excludedRequestDomains: ["accounts.youtube.com", "studio.youtube.com"], + }, + action: { + type: "redirect", + redirect: { + transform: { scheme: "https", host: randYoutubeInstance }, + }, + }, + }); redirectRules.push({ id: 2, priority: 1, diff --git a/src/background.js b/src/background.js index 936b181..f2c6026 100644 --- a/src/background.js +++ b/src/background.js @@ -428,9 +428,22 @@ function updateRules(parameterRedirectServices, customInstances) { } if (parameterRedirectServices.youtube) { - redirectRules.push( - createRedirectRule(1, "youtube.com", randYoutubeInstance) - ); + redirectRules.push({ + id: 1, + priority: 1, + condition: { + urlFilter: "||youtube.com", + resourceTypes: ["main_frame"], + excludedInitiatorDomains: [randYoutubeInstance], + excludedRequestDomains: ["accounts.youtube.com", "studio.youtube.com"], + }, + action: { + type: "redirect", + redirect: { + transform: { scheme: "https", host: randYoutubeInstance }, + }, + }, + }); redirectRules.push({ id: 2, priority: 1,