Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/elemHide.js

Issue 29853558: Noissue - Delete element hiding domain entry once all filters removed (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase, add tests Created Aug. 15, 2018, 10:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/elemHide.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -168,17 +168,22 @@
// Conditionally applied element hiding filters
else
{
let domains = filter.domains || defaultDomains;
for (let domain of domains.keys())
{
let filters = filtersByDomain.get(domain);
if (filters)
+ {
filters.delete(filter);
+
+ if (filters.size == 0)
+ filtersByDomain.delete(domain);
+ }
}
}
knownFilters.delete(filter);
FilterNotifier.emit("elemhideupdate");
},
/**
« no previous file with comments | « no previous file | test/elemHide.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld