mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2024-12-23 08:30:38 +01:00
Improve handling of missing resources (#1043)
This commit is contained in:
parent
0587988882
commit
ff4fc657a5
@ -33,9 +33,11 @@ var stateManager = {};
|
||||
stateManager.registerInjection = function (tabIdentifier, injection, url) {
|
||||
let injectionIdentifier, registeredTab, injectionCount, missingCount, initiatorDomain, listedToManipulateDOM;
|
||||
|
||||
injectionIdentifier = injection.source + injection.path;
|
||||
registeredTab = stateManager.tabs[tabIdentifier];
|
||||
registeredTab.injections[injectionIdentifier] = injection;
|
||||
if (injection['result'] !== false) {
|
||||
injectionIdentifier = injection.source + injection.path;
|
||||
registeredTab = stateManager.tabs[tabIdentifier];
|
||||
registeredTab.injections[injectionIdentifier] = injection;
|
||||
}
|
||||
|
||||
initiatorDomain = helpers.extractDomainFromUrl(url, true) || Address.EXAMPLE;
|
||||
listedToManipulateDOM = stateManager._domainIsListed(initiatorDomain, 'manipulate-dom');
|
||||
@ -357,7 +359,7 @@ chrome.webRequest.onErrorOccurred.addListener(function (requestDetails) {
|
||||
|
||||
chrome.webRequest.onBeforeRedirect.addListener(function (requestDetails) {
|
||||
let knownRequest = stateManager.requests[requestDetails.requestId];
|
||||
if (knownRequest['targetDetails']['result'] !== false) {
|
||||
if (knownRequest) {
|
||||
stateManager.registerInjection(
|
||||
knownRequest.tabIdentifier,
|
||||
knownRequest.targetDetails,
|
||||
|
Loading…
Reference in New Issue
Block a user