From 9562bac8f519f81848ac6f7530b77424a51b62d0 Mon Sep 17 00:00:00 2001 From: augmentedmode Date: Thu, 12 Dec 2024 14:49:16 -0500 Subject: [PATCH] fix: pr comment for redirects for main frame requests --- app/scripts/background.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index 7610b45a3c43..3adfa83fc32c 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -308,7 +308,9 @@ function maybeDetectPhishing(theController) { // blocking is better than tab redirection, as blocking will prevent // the browser from loading the page at all if (isManifestV2) { - // redirect the whole tab (even if it's a sub_frame request) + if (details.type === 'main_frame') { + return { redirectUrl: redirectHref }; + } redirectTab(details.tabId, redirectHref); return { cancel: true }; }