gorhill 10 years ago
parent dac3bab44f
commit 3fe5d48c05

@ -153,24 +153,6 @@ var collapser = (function() {
var newRequests = [];
var pendingRequests = {};
var pendingRequestCount = 0;
var backgroundImage = [
'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 srcProps = {
'iframe': 'src',
'img': 'src'
@ -205,7 +187,7 @@ var collapser = (function() {
return;
}
var collapse = response.collapse;
var bgImg = backgroundImage;
var bgImg = response.backgroundImage;
var i = requests.length;
var request, entry, target, tagName;
while ( i-- ) {

@ -509,6 +509,9 @@ var onMessage = function(request, sender, callback) {
collapse: µm.userSettings.collapseBlocked,
requests: evaluateURLs(tabId, request.requests)
};
if ( !response.collapse ) {
response.backgroundImage = vAPI.localStorage.getItem('placeholderBackgroundImage');
}
break;
case 'getUserAgentReplaceStr':

@ -44,17 +44,8 @@ var µm = µMatrix;
/******************************************************************************/
var onAllDone = function() {
µm.webRequest.start();
// https://github.com/chrisaljoudi/uBlock/issues/184
// Check for updates not too far in the future.
µm.assetUpdater.onStart.addListener(µm.updateStartHandler.bind(µm));
µm.assetUpdater.onCompleted.addListener(µm.updateCompleteHandler.bind(µm));
µ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;
@ -69,11 +60,43 @@ var onAllDone = function() {
// console.debug('clearBrowserCacheCallback()> vAPI.browserCache.clearByTime() called');
};
/******************************************************************************/
var onAllDone = function() {
µm.webRequest.start();
// https://github.com/chrisaljoudi/uBlock/issues/184
// Check for updates not too far in the future.
µm.assetUpdater.onStart.addListener(µm.updateStartHandler.bind(µm));
µm.assetUpdater.onCompleted.addListener(µm.updateCompleteHandler.bind(µm));
µm.assetUpdater.onAssetUpdated.addListener(µm.assetUpdatedHandler.bind(µm));
µm.assets.onAssetCacheRemoved.addListener(µm.assetCacheRemovedHandler.bind(µm));
µ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) {

Loading…
Cancel
Save