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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 29996555: Noissue - Lower-case URL in advance for location-only filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Feb. 2, 2019, 5:33 a.m.
Right Patch Set: Add JSDoc access tag Created Feb. 2, 2019, 10:54 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 this.isActiveOnDomain(docDomain, sitekey) && 875 this.isActiveOnDomain(docDomain, sitekey) &&
876 this.matchesLocation(location); 876 this.matchesLocation(location);
877 }, 877 },
878 878
879 /** 879 /**
880 * Checks whether the given URL matches this filter's pattern. 880 * Checks whether the given URL matches this filter's pattern.
881 * @param {string} location The URL to check. 881 * @param {string} location The URL to check.
882 * @param {?string} [lowerCaseLocation] The lower-case version of the URL to 882 * @param {?string} [lowerCaseLocation] The lower-case version of the URL to
883 * check, for case-insensitive matching. 883 * check, for case-insensitive matching.
884 * @returns {boolean} <code>true</code> if the URL matches. 884 * @returns {boolean} <code>true</code> if the URL matches.
885 * @package
885 */ 886 */
886 matchesLocation(location, lowerCaseLocation) 887 matchesLocation(location, lowerCaseLocation)
887 { 888 {
888 let {regexp} = this; 889 let {regexp} = this;
889 890
890 if (regexp) 891 if (regexp)
891 return regexp.test(location); 892 return regexp.test(location);
892 893
893 if (!this.matchCase) 894 if (!this.matchCase)
894 location = lowerCaseLocation || location.toLowerCase(); 895 location = lowerCaseLocation || location.toLowerCase();
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 1436
1436 /** 1437 /**
1437 * Script that should be executed 1438 * Script that should be executed
1438 * @type {string} 1439 * @type {string}
1439 */ 1440 */
1440 get script() 1441 get script()
1441 { 1442 {
1442 return this.body; 1443 return this.body;
1443 } 1444 }
1444 }); 1445 });
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