[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.
This commit is contained in:
Raymond Hill 2025-05-11 10:34:49 -04:00
parent 63eeaae5e9
commit 3ff54b7f2a
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -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);
}
}