diff --git a/src/js/3p-filters.js b/src/js/3p-filters.js index 277052963..5963c1e21 100644 --- a/src/js/3p-filters.js +++ b/src/js/3p-filters.js @@ -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); diff --git a/src/js/assets.js b/src/js/assets.js index d54d18288..163692dcc 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -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); }; diff --git a/src/js/storage.js b/src/js/storage.js index e977d4f6d..d88e82c69 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -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