This commit is contained in:
gorhill 2015-03-11 18:26:00 -04:00
parent d0113278aa
commit 32687c94f3
1 changed files with 24 additions and 20 deletions

View File

@ -25,7 +25,7 @@
// Load all: executed once. // Load all: executed once.
(function() { µBlock.restart = (function() {
'use strict'; 'use strict';
@ -58,9 +58,6 @@ var onAllReady = function() {
vAPI.onLoadAllCompleted(); vAPI.onLoadAllCompleted();
}; };
// Forbid remote fetching of assets
µb.assets.remoteFetchBarrier += 1;
/******************************************************************************/ /******************************************************************************/
// Filtering engines dependencies: // Filtering engines dependencies:
@ -188,18 +185,6 @@ var onFirstFetchReady = function(fetched) {
/******************************************************************************/ /******************************************************************************/
var fetchableProps = {
'compiledMagic': '',
'lastRestoreFile': '',
'lastRestoreTime': 0,
'lastBackupFile': '',
'lastBackupTime': 0,
'netWhitelist': '',
'selfie': null,
'selfieMagic': '',
'version': '0.0.0.0'
};
var toFetch = function(from, fetched) { var toFetch = function(from, fetched) {
for ( var k in from ) { for ( var k in from ) {
if ( from.hasOwnProperty(k) === false ) { if ( from.hasOwnProperty(k) === false ) {
@ -223,14 +208,33 @@ var fromFetch = function(to, fetched) {
/******************************************************************************/ /******************************************************************************/
toFetch(µb.localSettings, fetchableProps); return function() {
toFetch(µb.userSettings, fetchableProps); // Forbid remote fetching of assets
toFetch(µb.restoreBackupSettings, fetchableProps); µb.assets.remoteFetchBarrier += 1;
vAPI.storage.get(fetchableProps, onFirstFetchReady); var fetchableProps = {
'compiledMagic': '',
'lastRestoreFile': '',
'lastRestoreTime': 0,
'lastBackupFile': '',
'lastBackupTime': 0,
'netWhitelist': '',
'selfie': null,
'selfieMagic': '',
'version': '0.0.0.0'
};
toFetch(µb.localSettings, fetchableProps);
toFetch(µb.userSettings, fetchableProps);
toFetch(µb.restoreBackupSettings, fetchableProps);
vAPI.storage.get(fetchableProps, onFirstFetchReady);
};
/******************************************************************************/ /******************************************************************************/
})(); })();
/******************************************************************************/ /******************************************************************************/
µBlock.restart();