Left: | ||
Right: |
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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 result = this._matchesAnyInternal(location, typeMask, docDomain, | 421 result = this._matchesAnyInternal(location, typeMask, docDomain, |
422 thirdParty, sitekey, specificOnly); | 422 thirdParty, sitekey, specificOnly); |
423 | 423 |
424 if (this._resultCache.size >= this.maxCacheEntries) | 424 if (this._resultCache.size >= this.maxCacheEntries) |
425 this._resultCache.clear(); | 425 this._resultCache.clear(); |
426 | 426 |
427 this._resultCache.set(key, result); | 427 this._resultCache.set(key, result); |
428 | 428 |
429 return result; | 429 return result; |
430 } | 430 } |
431 | |
432 /** | |
433 * Tests whether the URL is whitelisted | |
434 * @see Matcher#matchesAny | |
435 * @inheritdoc | |
436 * @returns {boolean} | |
437 */ | |
438 isWhitelisted(location, typeMask, docDomain, thirdParty, sitekey, | |
439 specificOnly) | |
440 { | |
441 return !!this._whitelist.matchesAny(location, typeMask, docDomain, | |
442 thirdParty, sitekey, specificOnly); | |
443 } | |
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.
| |
431 } | 444 } |
432 | 445 |
433 exports.CombinedMatcher = CombinedMatcher; | 446 exports.CombinedMatcher = CombinedMatcher; |
434 | 447 |
435 /** | 448 /** |
436 * Shared {@link CombinedMatcher} instance that should usually be used. | 449 * Shared {@link CombinedMatcher} instance that should usually be used. |
437 * @type {CombinedMatcher} | 450 * @type {CombinedMatcher} |
438 */ | 451 */ |
439 let defaultMatcher = new CombinedMatcher(); | 452 let defaultMatcher = new CombinedMatcher(); |
440 | 453 |
441 exports.defaultMatcher = defaultMatcher; | 454 exports.defaultMatcher = defaultMatcher; |
OLD | NEW |