This commit is contained in:
gorhill 2017-05-08 14:00:41 -04:00
parent be07567f20
commit 1c7c703d8b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 22 additions and 6 deletions

View File

@ -1007,7 +1007,12 @@ var updateNext = function() {
if ( cacheEntry && (cacheEntry.writeTime + assetEntry.updateAfter * 86400000) > now ) { if ( cacheEntry && (cacheEntry.writeTime + assetEntry.updateAfter * 86400000) > now ) {
continue; continue;
} }
if ( fireNotification('before-asset-updated', { assetKey: assetKey }) !== false ) { if (
fireNotification(
'before-asset-updated',
{ assetKey: assetKey, type: assetEntry.content }
) !== false
) {
return assetKey; return assetKey;
} }
garbageCollectOne(assetKey); garbageCollectOne(assetKey);

View File

@ -1059,12 +1059,23 @@
µBlock.assetObserver = function(topic, details) { µBlock.assetObserver = function(topic, details) {
// Do not update filter list if not in use. // Do not update filter list if not in use.
if ( topic === 'before-asset-updated' ) { if ( topic === 'before-asset-updated' ) {
if ( details.type === 'filters' ) {
if ( if (
this.availableFilterLists.hasOwnProperty(details.assetKey) && this.availableFilterLists.hasOwnProperty(details.assetKey) === false ||
this.selectedFilterLists.indexOf(details.assetKey) === -1 this.selectedFilterLists.indexOf(details.assetKey) === -1
) { ) {
return false; return false;
} }
}
// https://github.com/gorhill/uBlock/issues/2594
if ( details.assetKey === 'ublock-resources' ) {
if (
this.hiddenSettings.ignoreRedirectFilters === true &&
this.hiddenSettings.ignoreScriptInjectFilters === true
) {
return false;
}
}
return; return;
} }