mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-16 01:06:14 +12:00
Fix exception thrown when a stock asset is removed
Related feedback: - https://www.reddit.com/r/uMatrix/comments/ftebgz/
This commit is contained in:
parent
be3990e24e
commit
c2b4adb7f1
|
@ -16,25 +16,6 @@
|
||||||
"assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat"
|
"assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"malware-0": {
|
|
||||||
"content": "filters",
|
|
||||||
"title": "Malware Domain List",
|
|
||||||
"contentURL": [
|
|
||||||
"https://www.malwaredomainlist.com/hostslist/hosts.txt",
|
|
||||||
"assets/thirdparties/www.malwaredomainlist.com/hostslist/hosts.txt"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"malware-1": {
|
|
||||||
"content": "filters",
|
|
||||||
"title": "Malware domains",
|
|
||||||
"contentURL": [
|
|
||||||
"https://mirror.cedia.org.ec/malwaredomains/justdomains",
|
|
||||||
"https://mirror1.malwaredomains.com/files/justdomains",
|
|
||||||
"assets/thirdparties/mirror1.malwaredomains.com/files/justdomains",
|
|
||||||
"assets/thirdparties/mirror1.malwaredomains.com/files/justdomains.txt"
|
|
||||||
],
|
|
||||||
"supportURL": "http://www.malwaredomains.com/"
|
|
||||||
},
|
|
||||||
"dpollock-0": {
|
"dpollock-0": {
|
||||||
"content": "filters",
|
"content": "filters",
|
||||||
"updateAfter": 11,
|
"updateAfter": 11,
|
||||||
|
|
|
@ -552,12 +552,22 @@
|
||||||
var usedCount = this.ubiquitousBlacklist.count;
|
var usedCount = this.ubiquitousBlacklist.count;
|
||||||
var duplicateCount = this.ubiquitousBlacklist.duplicateCount;
|
var duplicateCount = this.ubiquitousBlacklist.duplicateCount;
|
||||||
|
|
||||||
this.mergeHostsFileContent(details.content);
|
// https://www.reddit.com/r/uMatrix/comments/ftebgz/
|
||||||
|
// Be ready to deal with a removed asset.
|
||||||
|
|
||||||
|
if ( typeof details.content === 'string' && details.content !== '' ) {
|
||||||
|
this.mergeHostsFileContent(details.content);
|
||||||
|
}
|
||||||
|
|
||||||
usedCount = this.ubiquitousBlacklist.count - usedCount;
|
usedCount = this.ubiquitousBlacklist.count - usedCount;
|
||||||
duplicateCount = this.ubiquitousBlacklist.duplicateCount - duplicateCount;
|
duplicateCount = this.ubiquitousBlacklist.duplicateCount - duplicateCount;
|
||||||
|
|
||||||
let hostsFileMeta = this.liveHostsFiles.get(details.assetKey);
|
const hostsFileMeta = this.liveHostsFiles.get(details.assetKey);
|
||||||
|
if ( hostsFileMeta === undefined ) {
|
||||||
|
this.liveHostsFiles.delete(details.assetKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
hostsFileMeta.entryCount = usedCount + duplicateCount;
|
hostsFileMeta.entryCount = usedCount + duplicateCount;
|
||||||
hostsFileMeta.entryUsedCount = usedCount;
|
hostsFileMeta.entryUsedCount = usedCount;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue