mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-24 11:22:44 +01:00
fix #2464
This commit is contained in:
parent
dde8598ab5
commit
2dcf7b7974
@ -978,6 +978,12 @@ var FilterHostnameDict = function() {
|
||||
this.dict = new Set();
|
||||
};
|
||||
|
||||
Object.defineProperty(FilterHostnameDict.prototype, 'size', {
|
||||
get: function() {
|
||||
return this.dict.size;
|
||||
}
|
||||
});
|
||||
|
||||
FilterHostnameDict.prototype.add = function(hn) {
|
||||
if ( this.dict.has(hn) ) {
|
||||
return false;
|
||||
@ -986,6 +992,10 @@ FilterHostnameDict.prototype.add = function(hn) {
|
||||
return true;
|
||||
};
|
||||
|
||||
FilterHostnameDict.prototype.remove = function(hn) {
|
||||
return this.dict.delete(hn);
|
||||
};
|
||||
|
||||
FilterHostnameDict.prototype.match = function() {
|
||||
// TODO: mind IP addresses
|
||||
var pos,
|
||||
@ -2097,8 +2107,8 @@ FilterContainer.prototype.removeBadFilters = function() {
|
||||
continue;
|
||||
}
|
||||
if ( entry instanceof FilterHostnameDict ) {
|
||||
entry.delete(fclass); // 'fclass' is hostname
|
||||
if ( entry.dict.size === 0 ) {
|
||||
entry.remove(fclass); // 'fclass' is hostname
|
||||
if ( entry.size === 0 ) {
|
||||
this.categories.delete(hash);
|
||||
}
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user