mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2024-12-23 00:25:15 +01:00
Initial read from extension storage centralized (#561)
This commit is contained in:
parent
6ba26b7e36
commit
c034bf0c04
@ -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
|
||||
*/
|
||||
|
@ -72,6 +72,12 @@ main._initializeSettings = function () {
|
||||
'path': stateManager.selectedIcon
|
||||
}, '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);
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user