From 3ff54b7f2a7cf7abd56adf2c0a2fdaad06319208 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 11 May 2025 10:34:49 -0400 Subject: [PATCH] [mv3] Just force a reload when URL doesn't change Most of the time the URL doesn't change and just forcing a reload of the page is sufficient. When a document is strict-blocked, the URL must be updated however. --- platform/mv3/extension/js/popup.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/mv3/extension/js/popup.js b/platform/mv3/extension/js/popup.js index 2cb89045b..0556d6953 100644 --- a/platform/mv3/extension/js/popup.js +++ b/platform/mv3/extension/js/popup.js @@ -109,10 +109,13 @@ async function commitFilteringMode() { setFilteringMode(actualLevel); } if ( actualLevel !== beforeLevel && popupPanelData.autoReload ) { + const justReload = tabURL.href === currentTab.url; self.setTimeout(( ) => { - browser.tabs.update(currentTab.id, { - url: tabURL.href, - }); + if ( justReload ) { + browser.tabs.reload(currentTab.id); + } else { + browser.tabs.update(currentTab.id, { url: tabURL.href }); + } }, 437); } }