mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-04 10:09:38 +02:00
code review for #420: mind that the rule can apply everywhere
This commit is contained in:
parent
b9c1f2e397
commit
0d3dd3d2ec
@ -929,12 +929,16 @@ FilterContainer.prototype.addToSelectorCache = function(details) {
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
FilterContainer.prototype.removeFromSelectorCache = function(hostname, type) {
|
||||
var entry = this.selectorCache[hostname];
|
||||
if ( entry === undefined ) {
|
||||
return;
|
||||
FilterContainer.prototype.removeFromSelectorCache = function(targetHostname, type) {
|
||||
for ( var hostname in this.selectorCache ) {
|
||||
if ( this.selectorCache.hasOwnProperty(hostname) === false ) {
|
||||
continue;
|
||||
}
|
||||
if ( targetHostname !== '*' && hostname !== targetHostname ) {
|
||||
continue;
|
||||
}
|
||||
this.selectorCache[hostname].remove(type);
|
||||
}
|
||||
entry.remove(type);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -323,7 +323,7 @@ var matchWhitelistDirective = function(url, hostname, directive) {
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/420
|
||||
if ( details.requestType === 'sub_frame' && !details.block ) {
|
||||
this.cosmeticFilteringEngine.removeFromSelectorCache(details.pageHostname, 'net');
|
||||
this.cosmeticFilteringEngine.removeFromSelectorCache(details.hostname, 'net');
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user