mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-06-05 21:49:31 +02:00
Initial read from extension storage centralized (#561)
This commit is contained in:
@@ -139,31 +139,6 @@ interceptor._handleStorageChanged = function (changes) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializations
|
|
||||||
*/
|
|
||||||
|
|
||||||
interceptor.xhrTestDomain = Address.LOCALCDN;
|
|
||||||
interceptor.blockMissing = false;
|
|
||||||
interceptor.blockGoogleFonts = true;
|
|
||||||
interceptor.allowedDomainsGoogleFonts = {};
|
|
||||||
|
|
||||||
interceptor.relatedSettings = [];
|
|
||||||
|
|
||||||
interceptor.relatedSettings.push(Setting.AMOUNT_INJECTED);
|
|
||||||
interceptor.relatedSettings.push(Setting.XHR_TEST_DOMAIN);
|
|
||||||
interceptor.relatedSettings.push(Setting.BLOCK_MISSING);
|
|
||||||
interceptor.relatedSettings.push(Setting.ALLOWED_DOMAINS_GOOGLE_FONTS);
|
|
||||||
|
|
||||||
storageManager.type.get(interceptor.relatedSettings, function (items) {
|
|
||||||
storageManager.amountInjected = items.amountInjected || 0;
|
|
||||||
interceptor.xhrTestDomain = items.xhrTestDomain || Address.LOCALCDN;
|
|
||||||
interceptor.allowedDomainsGoogleFonts = items.allowedDomainsGoogleFonts || {};
|
|
||||||
interceptor.blockMissing = items.blockMissing === undefined ? false : items.blockMissing;
|
|
||||||
interceptor.blockGoogleFonts = items.blockGoogleFonts === undefined ? true : items.blockGoogleFonts;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event Handlers
|
* Event Handlers
|
||||||
*/
|
*/
|
||||||
|
@@ -72,6 +72,12 @@ main._initializeSettings = function () {
|
|||||||
'path': stateManager.selectedIcon
|
'path': stateManager.selectedIcon
|
||||||
}, 'Enabled');
|
}, 'Enabled');
|
||||||
|
|
||||||
|
storageManager.amountInjected = items.amountInjected || 0;
|
||||||
|
interceptor.xhrTestDomain = items.xhrTestDomain || Address.LOCALCDN;
|
||||||
|
interceptor.allowedDomainsGoogleFonts = items.allowedDomainsGoogleFonts || {};
|
||||||
|
interceptor.blockMissing = items.blockMissing === undefined ? false : items.blockMissing;
|
||||||
|
interceptor.blockGoogleFonts = items.blockGoogleFonts === undefined ? true : items.blockGoogleFonts;
|
||||||
|
|
||||||
storageManager.type.set(items);
|
storageManager.type.set(items);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user