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