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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 pattern = null; | 566 pattern = null; |
567 return processPatterns(); | 567 return processPatterns(); |
568 } | 568 } |
569 generator = evaluate(pattern.selectors, 0, "", | 569 generator = evaluate(pattern.selectors, 0, "", |
570 this.document, cssStyles); | 570 this.document, cssStyles); |
571 } | 571 } |
572 for (let selector of generator) | 572 for (let selector of generator) |
573 { | 573 { |
574 if (selector != null) | 574 if (selector != null) |
575 { | 575 { |
576 if (isSelectorHidingOnlyPattern(pattern)) | 576 if (this.alwaysHideWithSelector || |
| 577 isSelectorHidingOnlyPattern(pattern)) |
577 { | 578 { |
578 selectors.push(selector); | 579 selectors.push(selector); |
579 selectorFilters.push(pattern.text); | 580 selectorFilters.push(pattern.text); |
580 } | 581 } |
581 else | 582 else |
582 { | 583 { |
583 for (let element of this.document.querySelectorAll(selector)) | 584 for (let element of this.document.querySelectorAll(selector)) |
584 { | 585 { |
585 elements.push(element); | 586 elements.push(element); |
586 elementFilters.push(pattern.text); | 587 elementFilters.push(pattern.text); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 characterData: shouldObserveCharacterData(this.patterns), | 713 characterData: shouldObserveCharacterData(this.patterns), |
713 subtree: true | 714 subtree: true |
714 } | 715 } |
715 ); | 716 ); |
716 this.document.addEventListener("load", this.onLoad.bind(this), true); | 717 this.document.addEventListener("load", this.onLoad.bind(this), true); |
717 } | 718 } |
718 } | 719 } |
719 }; | 720 }; |
720 | 721 |
721 exports.ElemHideEmulation = ElemHideEmulation; | 722 exports.ElemHideEmulation = ElemHideEmulation; |
OLD | NEW |