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

Unified Diff: lib/abp2blocklist.js

Issue 29501571: Noissue - Skip unless-domain if list is empty (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created July 31, 2017, 12:34 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/abp2blocklist.js
===================================================================
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -637,17 +637,17 @@
}
newSelector.push(selector.substring(i));
return newSelector.join("");
}
function addCSSRules(rules, selectors, domain, exceptionDomains)
{
- let unlessDomain = exceptionDomains.size > 0 ? [] : null;
+ let unlessDomain = [];
exceptionDomains.forEach(name =>
{
// For domain-specific filters, include the exception domains only if
// they're subdomains of the given domain.
if (!domain || name.substr(-domain.length - 1) == "." + domain)
unlessDomain.push("*" + name);
});
@@ -662,17 +662,17 @@
let rule = {
trigger: {"url-filter": matchDomain(domain),
"url-filter-is-case-sensitive": true},
action: {type: "css-display-none",
selector: selector}
};
- if (unlessDomain)
+ if (unlessDomain.length > 0)
rule.trigger["unless-domain"] = unlessDomain;
rules.push(rule);
}
}
/**
* Check if two strings are a close match
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld