1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 15:32:28 +02:00
Raymond Hill 2018-10-24 20:02:15 -03:00
parent 7e6e35b996
commit c0fc7dd869
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 10 additions and 12 deletions

View File

@ -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);

View File

@ -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);
};

View File

@ -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