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

Delta Between Two Patch Sets: lib/matcher.js

Issue 5991150368325632: Issue 616 - Add specificOnly parameter to matchesAny (Closed)
Left Patch Set: Rebased onto typeMask changes Created July 14, 2015, 4:51 p.m.
Right Patch Set: Make use of new isGeneric filter method Created Aug. 25, 2015, 5:43 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 /** 165 /**
166 * Checks whether the entries for a particular keyword match a URL 166 * Checks whether the entries for a particular keyword match a URL
167 */ 167 */
168 _checkEntryMatch: function(keyword, location, typeMask, docDomain, thirdParty, sitekey, specificOnly) 168 _checkEntryMatch: function(keyword, location, typeMask, docDomain, thirdParty, sitekey, specificOnly)
169 { 169 {
170 let list = this.filterByKeyword[keyword]; 170 let list = this.filterByKeyword[keyword];
171 for (let i = 0; i < list.length; i++) 171 for (let i = 0; i < list.length; i++)
172 { 172 {
173 let filter = list[i]; 173 let filter = list[i];
174 174
175 if (specificOnly && (!filter.domains || filter.domains[""]) && 175 if (specificOnly && filter.isGeneric() &&
176 !(filter instanceof WhitelistFilter)) 176 !(filter instanceof WhitelistFilter))
177 continue; 177 continue;
178 178
179 if (filter.matches(location, typeMask, docDomain, thirdParty, sitekey)) 179 if (filter.matches(location, typeMask, docDomain, thirdParty, sitekey))
180 return filter; 180 return filter;
181 } 181 }
182 return null; 182 return null;
183 }, 183 },
184 184
185 /** 185 /**
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 return result; 399 return result;
400 } 400 }
401 } 401 }
402 402
403 /** 403 /**
404 * Shared CombinedMatcher instance that should usually be used. 404 * Shared CombinedMatcher instance that should usually be used.
405 * @type CombinedMatcher 405 * @type CombinedMatcher
406 */ 406 */
407 let defaultMatcher = exports.defaultMatcher = new CombinedMatcher(); 407 let defaultMatcher = exports.defaultMatcher = new CombinedMatcher();
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld