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 ) {
continue;
}
if ( fireNotification('before-asset-updated', { assetKey: assetKey }) !== false ) {
if (
fireNotification(
'before-asset-updated',
{ assetKey: assetKey, type: assetEntry.content }
) !== false
) {
return assetKey;
}
garbageCollectOne(assetKey);

View File

@ -1059,11 +1059,22 @@
µBlock.assetObserver = function(topic, details) {
// Do not update filter list if not in use.
if ( topic === 'before-asset-updated' ) {
if (
this.availableFilterLists.hasOwnProperty(details.assetKey) &&
this.selectedFilterLists.indexOf(details.assetKey) === -1
) {
return false;
if ( details.type === 'filters' ) {
if (
this.availableFilterLists.hasOwnProperty(details.assetKey) === false ||
this.selectedFilterLists.indexOf(details.assetKey) === -1
) {
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;
}