Do not inject scriptlets on navigation events in Firefox

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2343
This commit is contained in:
Raymond Hill 2022-10-28 11:07:46 -04:00
parent df1542e382
commit 4863f3093e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 8 additions and 1 deletions

View File

@ -916,6 +916,10 @@ vAPI.Tabs = class extends vAPI.Tabs {
// For non-network URIs, defer scriptlet injection to content script. The // For non-network URIs, defer scriptlet injection to content script. The
// reason for this is that we need the effective URL and this information // reason for this is that we need the effective URL and this information
// is not available at this point. // is not available at this point.
//
// https://github.com/uBlockOrigin/uBlock-issues/issues/2343
// uBO's isolated world in Firefox just does not work as expected at
// point, so we have to wait before injecting scriptlets.
onNavigation(details) { onNavigation(details) {
super.onNavigation(details); super.onNavigation(details);
const { frameId, tabId, url } = details; const { frameId, tabId, url } = details;
@ -929,7 +933,10 @@ vAPI.Tabs = class extends vAPI.Tabs {
const pageStore = µb.pageStoreFromTabId(tabId); const pageStore = µb.pageStoreFromTabId(tabId);
if ( pageStore === null ) { return; } if ( pageStore === null ) { return; }
pageStore.setFrameURL(details); pageStore.setFrameURL(details);
if ( pageStore.getNetFilteringSwitch() ) { if (
vAPI.webextFlavor.soup.has('firefox') === false &&
pageStore.getNetFilteringSwitch()
) {
scriptletFilteringEngine.injectNow(details); scriptletFilteringEngine.injectNow(details);
} }
} }