| Index: lib/content/elemHideEmulation.js |
| =================================================================== |
| --- a/lib/content/elemHideEmulation.js |
| +++ b/lib/content/elemHideEmulation.js |
| @@ -12,17 +12,17 @@ |
| * GNU General Public License for more details. |
| * |
| * You should have received a copy of the GNU General Public License |
| * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| */ |
| "use strict"; |
| -const {textToRegExp, filterToRegExp, splitSelector} = require("../common"); |
| +import {textToRegExp, filterToRegExp, splitSelector} from "../common"; |
| let MIN_INVOCATION_INTERVAL = 3000; |
| const MAX_SYNCHRONOUS_PROCESSING_TIME = 50; |
| const abpSelectorRegexp = /:-abp-([\w-]+)\(/i; |
| /** Return position of node from parent. |
| * @param {Node} node the node to find the position of. |
| * @return {number} One-based index like for :nth-child(), or 0 on error. |
| @@ -405,17 +405,17 @@ |
| // one of the patterns. |
| return patterns.some( |
| pattern => pattern.selectors.some( |
| selector => selector.dependsOnCharacterData |
| ) |
| ); |
| } |
| -function ElemHideEmulation(addSelectorsFunc, hideElemsFunc) |
| +export function ElemHideEmulation(addSelectorsFunc, hideElemsFunc) |
| { |
| this.document = document; |
| this.addSelectorsFunc = addSelectorsFunc; |
| this.hideElemsFunc = hideElemsFunc; |
| this.observer = new MutationObserver(this.observe.bind(this)); |
| } |
| ElemHideEmulation.prototype = { |
| @@ -712,10 +712,8 @@ |
| characterData: shouldObserveCharacterData(this.patterns), |
| subtree: true |
| } |
| ); |
| this.document.addEventListener("load", this.onLoad.bind(this), true); |
| } |
| } |
| }; |
| - |
| -exports.ElemHideEmulation = ElemHideEmulation; |