mirror of https://github.com/gorhill/uBlock.git
This commit is contained in:
parent
7e6e35b996
commit
c0fc7dd869
|
@ -1,7 +1,7 @@
|
|||
/*******************************************************************************
|
||||
|
||||
uBlock Origin - a browser extension to block requests.
|
||||
Copyright (C) 2014-2018 Raymond Hill
|
||||
Copyright (C) 2014-present Raymond Hill
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -326,7 +326,9 @@ var renderWidgets = function() {
|
|||
/******************************************************************************/
|
||||
|
||||
var updateAssetStatus = function(details) {
|
||||
var li = document.querySelector('#lists .listEntry[data-listkey="' + details.key + '"]');
|
||||
let li = document.querySelector(
|
||||
'#lists .listEntry[data-listkey="' + details.key + '"]'
|
||||
);
|
||||
if ( li === null ) { return; }
|
||||
li.classList.toggle('failed', !!details.failed);
|
||||
li.classList.toggle('obsolete', !details.cached);
|
||||
|
|
|
@ -515,14 +515,6 @@ var assetCacheWrite = function(assetKey, details, callback) {
|
|||
return assetCacheRemove(assetKey, callback);
|
||||
}
|
||||
|
||||
let reportBack = function() {
|
||||
let details = { assetKey: assetKey, content: content };
|
||||
if ( typeof callback === 'function' ) {
|
||||
callback(details);
|
||||
}
|
||||
fireNotification('after-asset-updated', details);
|
||||
};
|
||||
|
||||
let onReady = function() {
|
||||
let entry = assetCacheRegistry[assetKey];
|
||||
if ( entry === undefined ) {
|
||||
|
@ -534,7 +526,12 @@ var assetCacheWrite = function(assetKey, details, callback) {
|
|||
}
|
||||
let bin = { assetCacheRegistry: assetCacheRegistry };
|
||||
bin[internalKey] = content;
|
||||
µBlock.cacheStorage.set(bin, reportBack);
|
||||
µBlock.cacheStorage.set(bin);
|
||||
let result = { assetKey: assetKey, content: content };
|
||||
if ( typeof callback === 'function' ) {
|
||||
callback(result);
|
||||
}
|
||||
fireNotification('after-asset-updated', result);
|
||||
};
|
||||
getAssetCacheRegistry(onReady);
|
||||
};
|
||||
|
|
|
@ -1284,7 +1284,6 @@
|
|||
what: 'assetUpdated',
|
||||
key: details.assetKey,
|
||||
cached: cached
|
||||
|
||||
});
|
||||
// https://github.com/gorhill/uBlock/issues/2585
|
||||
// Whenever an asset is overwritten, the current selfie is quite
|
||||
|
|
Loading…
Reference in New Issue