|
|
@ -44,6 +44,24 @@ var µm = µMatrix; |
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
// Browser data jobs
|
|
|
|
|
|
|
|
var jobCallback = function() { |
|
|
|
if ( !µm.userSettings.clearBrowserCache ) { |
|
|
|
return; |
|
|
|
} |
|
|
|
µm.clearBrowserCacheCycle -= 15; |
|
|
|
if ( µm.clearBrowserCacheCycle > 0 ) { |
|
|
|
return; |
|
|
|
} |
|
|
|
µm.clearBrowserCacheCycle = µm.userSettings.clearBrowserCacheAfter; |
|
|
|
µm.browserCacheClearedCounter++; |
|
|
|
vAPI.browserCache.clearByTime(0); |
|
|
|
// console.debug('clearBrowserCacheCallback()> vAPI.browserCache.clearByTime() called');
|
|
|
|
}; |
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
var onAllDone = function() { |
|
|
|
µm.webRequest.start(); |
|
|
|
|
|
|
@ -54,26 +72,31 @@ var onAllDone = function() { |
|
|
|
µm.assetUpdater.onAssetUpdated.addListener(µm.assetUpdatedHandler.bind(µm)); |
|
|
|
µm.assets.onAssetCacheRemoved.addListener(µm.assetCacheRemovedHandler.bind(µm)); |
|
|
|
|
|
|
|
// Browser data jobs
|
|
|
|
var jobCallback = function() { |
|
|
|
if ( !µm.userSettings.clearBrowserCache ) { |
|
|
|
return; |
|
|
|
} |
|
|
|
µm.clearBrowserCacheCycle -= 15; |
|
|
|
if ( µm.clearBrowserCacheCycle > 0 ) { |
|
|
|
return; |
|
|
|
} |
|
|
|
µm.clearBrowserCacheCycle = µm.userSettings.clearBrowserCacheAfter; |
|
|
|
µm.browserCacheClearedCounter++; |
|
|
|
vAPI.browserCache.clearByTime(0); |
|
|
|
// console.debug('clearBrowserCacheCallback()> vAPI.browserCache.clearByTime() called');
|
|
|
|
}; |
|
|
|
|
|
|
|
µMatrix.asyncJobs.add('clearBrowserCache', null, jobCallback, 15 * 60 * 1000, true); |
|
|
|
|
|
|
|
// Important: remove barrier to remote fetching, this was useful only
|
|
|
|
// for launch time.
|
|
|
|
µm.assets.remoteFetchBarrier -= 1; |
|
|
|
|
|
|
|
if ( vAPI.localStorage.getItem('placeholderBackgroundImage') === null ) { |
|
|
|
vAPI.localStorage.setItem('placeholderBackgroundImage', [ |
|
|
|
'linear-gradient(0deg,', |
|
|
|
'rgba(0,0,0,0.02) 25%,', |
|
|
|
'rgba(0,0,0,0.05) 25%,', |
|
|
|
'rgba(0,0,0,0.05) 75%,', |
|
|
|
'rgba(0,0,0,0.02) 75%,', |
|
|
|
'rgba(0,0,0,0.02)', |
|
|
|
') center center / 10px 10px repeat scroll,', |
|
|
|
'linear-gradient(', |
|
|
|
'90deg,', |
|
|
|
'rgba(0,0,0,0.02) 25%,', |
|
|
|
'rgba(0,0,0,0.05) 25%,', |
|
|
|
'rgba(0,0,0,0.05) 75%,', |
|
|
|
'rgba(0,0,0,0.02) 75%,', |
|
|
|
'rgba(0,0,0,0.02)', |
|
|
|
') center center / 10px 10px repeat scroll' |
|
|
|
].join('')); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var onTabsReady = function(tabs) { |
|
|
|