LEFT | RIGHT |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 /** |
| 69 * Adds a filter to the lookup table of filters by domain. |
| 70 * @param {Filter} filter |
| 71 */ |
68 function addToFiltersByDomain(filter) | 72 function addToFiltersByDomain(filter) |
69 { | 73 { |
70 let domains = filter.domains || defaultDomains; | 74 let domains = filter.domains || defaultDomains; |
71 for (let [domain, isIncluded] of domains) | 75 for (let [domain, isIncluded] of domains) |
72 { | 76 { |
73 // There's no need to note that a filter is generically disabled. | 77 // There's no need to note that a filter is generically disabled. |
74 if (!isIncluded && domain == "") | 78 if (!isIncluded && domain == "") |
75 continue; | 79 continue; |
76 | 80 |
77 let filters = filtersByDomain.get(domain); | 81 let filters = filtersByDomain.get(domain); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 if (currentDomain == "") | 294 if (currentDomain == "") |
291 break; | 295 break; |
292 | 296 |
293 let nextDot = currentDomain.indexOf("."); | 297 let nextDot = currentDomain.indexOf("."); |
294 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); | 298 currentDomain = nextDot == -1 ? "" : currentDomain.substr(nextDot + 1); |
295 } | 299 } |
296 | 300 |
297 return selectors; | 301 return selectors; |
298 } | 302 } |
299 }; | 303 }; |
LEFT | RIGHT |