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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 return patterns.some(pattern => pattern.maybeDependsOnAttributes); | 598 return patterns.some(pattern => pattern.maybeDependsOnAttributes); |
599 } | 599 } |
600 | 600 |
601 function shouldObserveCharacterData(patterns) | 601 function shouldObserveCharacterData(patterns) |
602 { | 602 { |
603 return patterns.some(pattern => pattern.dependsOnCharacterData); | 603 return patterns.some(pattern => pattern.dependsOnCharacterData); |
604 } | 604 } |
605 | 605 |
606 class ElemHideEmulation | 606 class ElemHideEmulation |
607 { | 607 { |
608 constructor(addSelectorsFunc, hideElemsFunc) | 608 constructor(hideElemsFunc) |
609 { | 609 { |
610 this._filteringInProgress = false; | 610 this._filteringInProgress = false; |
611 this._lastInvocation = -MIN_INVOCATION_INTERVAL; | 611 this._lastInvocation = -MIN_INVOCATION_INTERVAL; |
612 this._scheduledProcessing = null; | 612 this._scheduledProcessing = null; |
613 | 613 |
614 this.document = document; | 614 this.document = document; |
615 this.hideElemsFunc = hideElemsFunc; | 615 this.hideElemsFunc = hideElemsFunc; |
616 this.observer = new MutationObserver(this.observe.bind(this)); | 616 this.observer = new MutationObserver(this.observe.bind(this)); |
617 } | 617 } |
618 | 618 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 characterData: shouldObserveCharacterData(this.patterns), | 965 characterData: shouldObserveCharacterData(this.patterns), |
966 subtree: true | 966 subtree: true |
967 } | 967 } |
968 ); | 968 ); |
969 this.document.addEventListener("load", this.onLoad.bind(this), true); | 969 this.document.addEventListener("load", this.onLoad.bind(this), true); |
970 } | 970 } |
971 } | 971 } |
972 } | 972 } |
973 | 973 |
974 exports.ElemHideEmulation = ElemHideEmulation; | 974 exports.ElemHideEmulation = ElemHideEmulation; |
LEFT | RIGHT |