OLD | NEW |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 /** |
186 * Tests whether the URL matches any of the known filters | 186 * Tests whether the URL matches any of the known filters |
187 * @param {String} location URL to be tested | 187 * @param {String} location URL to be tested |
188 * @param {String} typeMask bitmask of content / request types to match | 188 * @param {number} typeMask bitmask of content / request types to match |
189 * @param {String} docDomain domain name of the document that loads the URL | 189 * @param {String} docDomain domain name of the document that loads the URL |
190 * @param {Boolean} thirdParty should be true if the URL is a third-party requ
est | 190 * @param {Boolean} thirdParty should be true if the URL is a third-party requ
est |
191 * @param {String} sitekey public key provided by the document | 191 * @param {String} sitekey public key provided by the document |
192 * @param {Boolean} specificOnly should be true if generic matches should be i
gnored | 192 * @param {Boolean} specificOnly should be true if generic matches should be i
gnored |
193 * @return {RegExpFilter} matching filter or null | 193 * @return {RegExpFilter} matching filter or null |
194 */ | 194 */ |
195 matchesAny: function(location, typeMask, docDomain, thirdParty, sitekey, speci
ficOnly) | 195 matchesAny: function(location, typeMask, docDomain, thirdParty, sitekey, speci
ficOnly) |
196 { | 196 { |
197 let candidates = location.toLowerCase().match(/[a-z0-9%]{3,}/g); | 197 let candidates = location.toLowerCase().match(/[a-z0-9%]{3,}/g); |
198 if (candidates === null) | 198 if (candidates === null) |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(); |
OLD | NEW |