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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 30000586: Issue 7265 - Orgnanize request blocking filters by domain (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Feb. 6, 2019, 3:19 p.m.
Right Patch Set: Rebase Created Feb. 7, 2019, 3:45 a.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 | lib/matcher.js » ('j') | 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-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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 * @param {string} [docDomain] domain name of the document that loads the URL 864 * @param {string} [docDomain] domain name of the document that loads the URL
865 * @param {boolean} [thirdParty] should be true if the URL is a third-party 865 * @param {boolean} [thirdParty] should be true if the URL is a third-party
866 * request 866 * request
867 * @param {string} [sitekey] public key provided by the document 867 * @param {string} [sitekey] public key provided by the document
868 * @return {boolean} true in case of a match 868 * @return {boolean} true in case of a match
869 */ 869 */
870 matches(location, typeMask, docDomain, thirdParty, sitekey) 870 matches(location, typeMask, docDomain, thirdParty, sitekey)
871 { 871 {
872 return (this.contentType & typeMask) != 0 && 872 return (this.contentType & typeMask) != 0 &&
873 (this.thirdParty == null || this.thirdParty == thirdParty) && 873 (this.thirdParty == null || this.thirdParty == thirdParty) &&
874 this.matchesLocation(location) && 874 (this.regexp ? (this.isActiveOnDomain(docDomain, sitekey) &&
875 this.isActiveOnDomain(docDomain, sitekey); 875 this.matchesLocation(location)) :
876 (this.matchesLocation(location) &&
877 this.isActiveOnDomain(docDomain, sitekey)));
876 }, 878 },
877 879
878 /** 880 /**
879 * Checks whether the given URL matches this filter without checking the 881 * Checks whether the given URL matches this filter without checking the
880 * filter's domains. 882 * filter's domains.
881 * @param {string} location 883 * @param {string} location
882 * @param {number} typeMask 884 * @param {number} typeMask
883 * @param {boolean} [thirdParty] 885 * @param {boolean} [thirdParty]
884 * @param {string} [sitekey] 886 * @param {string} [sitekey]
885 * @return {boolean} 887 * @return {boolean}
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 1446
1445 /** 1447 /**
1446 * Script that should be executed 1448 * Script that should be executed
1447 * @type {string} 1449 * @type {string}
1448 */ 1450 */
1449 get script() 1451 get script()
1450 { 1452 {
1451 return this.body; 1453 return this.body;
1452 } 1454 }
1453 }); 1455 });
LEFTRIGHT
« no previous file | lib/matcher.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld