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

Unified Diff: lib/snippets.js

Issue 29865583: Issue 6886 - Return snippet filters instead of just scripts (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: rename it getFiltersForDomain (for real) Created Aug. 27, 2018, 12:21 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/snippets.js » ('j') | test/snippets.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/snippets.js
===================================================================
--- a/lib/snippets.js
+++ b/lib/snippets.js
@@ -56,28 +56,28 @@
* @param {SnippetFilter} filter
*/
remove(filter)
{
filters.delete(filter.text);
},
/**
- * Returns a list of all scripts active on a particular domain
+ * Returns a list of all snippet filters active on a particular domain
* @param {string} domain
- * @return {string[]}
+ * @return {Array.<SnippetFilter>}
*/
- getScriptsForDomain(domain)
+ getFiltersForDomain(domain)
{
let result = [];
for (let text of filters)
{
let filter = Filter.fromText(text);
if (filter.isActiveOnDomain(domain))
- result.push(filter.script);
+ result.push(filter);
}
return result;
}
};
exports.Snippets = Snippets;
/**
« no previous file with comments | « no previous file | test/snippets.js » ('j') | test/snippets.js » ('J')

Powered by Google App Engine
This is Rietveld