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

Unified Diff: lib/matcher.js

Issue 29961555: Issue 7162 - Add isWhitelisted method to CombinedMatcher (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Dec. 9, 2018, 11:54 a.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/matcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -423,16 +423,29 @@
if (this._resultCache.size >= this.maxCacheEntries)
this._resultCache.clear();
this._resultCache.set(key, result);
return result;
}
+
+ /**
+ * Tests whether the URL is whitelisted
+ * @see Matcher#matchesAny
+ * @inheritdoc
+ * @returns {boolean}
+ */
+ isWhitelisted(location, typeMask, docDomain, thirdParty, sitekey,
+ specificOnly)
+ {
+ return !!this._whitelist.matchesAny(location, typeMask, docDomain,
+ thirdParty, sitekey, specificOnly);
+ }
hub 2018/12/11 13:59:54 do we use this anywhere?
Manish Jethani 2018/12/12 00:48:06 We will call this function from lib/filterComposer
hub 2018/12/12 07:27:09 Acknowledged.
}
exports.CombinedMatcher = CombinedMatcher;
/**
* Shared {@link CombinedMatcher} instance that should usually be used.
* @type {CombinedMatcher}
*/
« no previous file with comments | « no previous file | test/matcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld