1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 17:49:39 +02:00

Inject scriptlets at webNavigation.onCommitted time in Firefox

Just as is the case with Chromium.

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1694
This commit is contained in:
Raymond Hill 2021-08-25 09:24:10 -04:00
parent 92df3c9c22
commit 7ee9c21b37
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 2 additions and 10 deletions

View File

@ -127,7 +127,6 @@ const µBlock = { // jshint ignore:line
privacySettingsSupported: vAPI.browserSettings instanceof Object, privacySettingsSupported: vAPI.browserSettings instanceof Object,
cloudStorageSupported: vAPI.cloud instanceof Object, cloudStorageSupported: vAPI.cloud instanceof Object,
canFilterResponseData: typeof browser.webRequest.filterResponseData === 'function', canFilterResponseData: typeof browser.webRequest.filterResponseData === 'function',
canInjectScriptletsNow: vAPI.webextFlavor.soup.has('chromium'),
// https://github.com/chrisaljoudi/uBlock/issues/180 // https://github.com/chrisaljoudi/uBlock/issues/180
// Whitelist directives need to be loaded once the PSL is available // Whitelist directives need to be loaded once the PSL is available

View File

@ -627,10 +627,7 @@ const retrieveContentScriptParameters = async function(sender, request) {
// https://github.com/uBlockOrigin/uBlock-issues/issues/688#issuecomment-748179731 // https://github.com/uBlockOrigin/uBlock-issues/issues/688#issuecomment-748179731
// For non-network URIs, scriptlet injection is deferred to here. The // For non-network URIs, scriptlet injection is deferred to here. The
// effective URL is available here in `request.url`. // effective URL is available here in `request.url`.
if ( if ( isNetworkURI(sender.frameURL) === false ) {
µb.canInjectScriptletsNow === false ||
isNetworkURI(sender.frameURL) === false
) {
response.scriptlets = scriptletFilteringEngine.retrieve(request); response.scriptlets = scriptletFilteringEngine.retrieve(request);
} }

View File

@ -913,11 +913,7 @@ 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 ( if ( isNetworkURI(url) && pageStore.getNetFilteringSwitch() ) {
µb.canInjectScriptletsNow &&
isNetworkURI(url) &&
pageStore.getNetFilteringSwitch()
) {
scriptletFilteringEngine.injectNow(details); scriptletFilteringEngine.injectNow(details);
} }
} }