mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2024-12-23 16:44:34 +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) {
|
stateManager.registerInjection = function (tabIdentifier, injection, url) {
|
||||||
let injectionIdentifier, registeredTab, injectionCount, missingCount, initiatorDomain, listedToManipulateDOM;
|
let injectionIdentifier, registeredTab, injectionCount, missingCount, initiatorDomain, listedToManipulateDOM;
|
||||||
|
|
||||||
injectionIdentifier = injection.source + injection.path;
|
if (injection['result'] !== false) {
|
||||||
registeredTab = stateManager.tabs[tabIdentifier];
|
injectionIdentifier = injection.source + injection.path;
|
||||||
registeredTab.injections[injectionIdentifier] = injection;
|
registeredTab = stateManager.tabs[tabIdentifier];
|
||||||
|
registeredTab.injections[injectionIdentifier] = injection;
|
||||||
|
}
|
||||||
|
|
||||||
initiatorDomain = helpers.extractDomainFromUrl(url, true) || Address.EXAMPLE;
|
initiatorDomain = helpers.extractDomainFromUrl(url, true) || Address.EXAMPLE;
|
||||||
listedToManipulateDOM = stateManager._domainIsListed(initiatorDomain, 'manipulate-dom');
|
listedToManipulateDOM = stateManager._domainIsListed(initiatorDomain, 'manipulate-dom');
|
||||||
@ -357,7 +359,7 @@ chrome.webRequest.onErrorOccurred.addListener(function (requestDetails) {
|
|||||||
|
|
||||||
chrome.webRequest.onBeforeRedirect.addListener(function (requestDetails) {
|
chrome.webRequest.onBeforeRedirect.addListener(function (requestDetails) {
|
||||||
let knownRequest = stateManager.requests[requestDetails.requestId];
|
let knownRequest = stateManager.requests[requestDetails.requestId];
|
||||||
if (knownRequest['targetDetails']['result'] !== false) {
|
if (knownRequest) {
|
||||||
stateManager.registerInjection(
|
stateManager.registerInjection(
|
||||||
knownRequest.tabIdentifier,
|
knownRequest.tabIdentifier,
|
||||||
knownRequest.targetDetails,
|
knownRequest.targetDetails,
|
||||||
|
Loading…
Reference in New Issue
Block a user