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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 let defaultDomains = new Map([["", true]]); | 54 let defaultDomains = new Map([["", true]]); |
55 | 55 |
56 /** | 56 /** |
57 * Set containing known element hiding and exception filters | 57 * Set containing known element hiding and exception filters |
58 * @type {Set.<ElemHideBase>} | 58 * @type {Set.<ElemHideBase>} |
59 */ | 59 */ |
60 let knownFilters = new Set(); | 60 let knownFilters = new Set(); |
61 | 61 |
62 /** | 62 /** |
63 * Lookup table, lists of element hiding exceptions by selector | 63 * Lookup table, lists of element hiding exceptions by selector |
64 * @type {Map.<string,Filter>} | 64 * @type {Map.<string,Filter[]>} |
65 */ | 65 */ |
66 let exceptions = new Map(); | 66 let exceptions = new Map(); |
67 | 67 |
68 /** | 68 /** |
69 * Adds a filter to the lookup table of filters by domain. | 69 * Adds a filter to the lookup table of filters by domain. |
70 * @param {Filter} filter | 70 * @param {Filter} filter |
71 */ | 71 */ |
72 function addToFiltersByDomain(filter) | 72 function addToFiltersByDomain(filter) |
73 { | 73 { |
74 let domains = filter.domains || defaultDomains; | 74 let domains = filter.domains || defaultDomains; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 let nextDot = currentDomain.indexOf("."); | 294 let nextDot = currentDomain.indexOf("."); |
295 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); | 295 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |
296 } | 296 } |
297 | 297 |
298 if (criteria < ElemHide.NO_UNCONDITIONAL) | 298 if (criteria < ElemHide.NO_UNCONDITIONAL) |
299 selectors = getUnconditionalSelectors().concat(selectors); | 299 selectors = getUnconditionalSelectors().concat(selectors); |
300 | 300 |
301 return selectors; | 301 return selectors; |
302 } | 302 } |
303 }; | 303 }; |
OLD | NEW |