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

Side by Side Diff: lib/filterClasses.js

Issue 30000594: Noissue - Check domains first for regular expression filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Feb. 6, 2019, 4:57 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 * @param {string} [docDomain] domain name of the document that loads the URL 863 * @param {string} [docDomain] domain name of the document that loads the URL
864 * @param {boolean} [thirdParty] should be true if the URL is a third-party 864 * @param {boolean} [thirdParty] should be true if the URL is a third-party
865 * request 865 * request
866 * @param {string} [sitekey] public key provided by the document 866 * @param {string} [sitekey] public key provided by the document
867 * @return {boolean} true in case of a match 867 * @return {boolean} true in case of a match
868 */ 868 */
869 matches(location, typeMask, docDomain, thirdParty, sitekey) 869 matches(location, typeMask, docDomain, thirdParty, sitekey)
870 { 870 {
871 return (this.contentType & typeMask) != 0 && 871 return (this.contentType & typeMask) != 0 &&
872 (this.thirdParty == null || this.thirdParty == thirdParty) && 872 (this.thirdParty == null || this.thirdParty == thirdParty) &&
873 this.matchesLocation(location) && 873 (this.regexp ? (this.isActiveOnDomain(docDomain, sitekey) &&
874 this.isActiveOnDomain(docDomain, sitekey); 874 this.matchesLocation(location)) :
875 (this.matchesLocation(location) &&
876 this.isActiveOnDomain(docDomain, sitekey)));
875 }, 877 },
876 878
877 /** 879 /**
878 * Checks whether the given URL matches this filter's pattern. 880 * Checks whether the given URL matches this filter's pattern.
879 * @param {string} location The URL to check. 881 * @param {string} location The URL to check.
880 * @param {?string} [lowerCaseLocation] The lower-case version of the URL to 882 * @param {?string} [lowerCaseLocation] The lower-case version of the URL to
881 * check, for case-insensitive matching. 883 * check, for case-insensitive matching.
882 * @returns {boolean} <code>true</code> if the URL matches. 884 * @returns {boolean} <code>true</code> if the URL matches.
883 * @package 885 * @package
884 */ 886 */
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 1436
1435 /** 1437 /**
1436 * Script that should be executed 1438 * Script that should be executed
1437 * @type {string} 1439 * @type {string}
1438 */ 1440 */
1439 get script() 1441 get script()
1440 { 1442 {
1441 return this.body; 1443 return this.body;
1442 } 1444 }
1443 }); 1445 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld