| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 /** @module filterComposer */ | 18 /** @module filterComposer */ |
| 19 | 19 |
| 20 "use strict"; | 20 "use strict"; |
| 21 | 21 |
| 22 const {defaultMatcher} = require("../adblockpluscore/lib/matcher"); | 22 const {defaultMatcher} = require("../adblockpluscore/lib/matcher"); |
| 23 const {RegExpFilter} = require("../adblockpluscore/lib/filterClasses"); | 23 const {RegExpFilter} = require("../adblockpluscore/lib/filterClasses"); |
| 24 const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); | 24 const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
| 25 const {Prefs} = require("./prefs"); | 25 const {Prefs} = require("./prefs"); |
| 26 const {extractHostFromFrame, isThirdParty} = require("./url"); | 26 const {extractHostFromFrame, isThirdParty} = require("./url"); |
| 27 const {getKey, checkWhitelisted} = require("./whitelisting"); | 27 const {getKey, checkWhitelisted} = require("./whitelisting"); |
| 28 const {port} = require("./messaging"); | 28 const {port} = require("./messaging"); |
| 29 const info = require("../buildtools/info"); | 29 const info = require("info"); |
| 30 | 30 |
| 31 let readyPages = new ext.PageMap(); | 31 let readyPages = new ext.PageMap(); |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * Checks whether the given page is ready to use the filter composer | 34 * Checks whether the given page is ready to use the filter composer |
| 35 * | 35 * |
| 36 * @param {Page} page | 36 * @param {Page} page |
| 37 * @return {boolean} | 37 * @return {boolean} |
| 38 */ | 38 */ |
| 39 exports.isPageReady = page => | 39 exports.isPageReady = page => |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // When tabs start loading we send them a message to ensure that the state | 331 // When tabs start loading we send them a message to ensure that the state |
| 332 // of the "block element" tool is reset. This is necessary since Firefox will | 332 // of the "block element" tool is reset. This is necessary since Firefox will |
| 333 // sometimes cache the state of a tab when the user navigates back / forward, | 333 // sometimes cache the state of a tab when the user navigates back / forward, |
| 334 // which includes the state of the "block element" tool. | 334 // which includes the state of the "block element" tool. |
| 335 // Since sending this message will often fail (e.g. for new tabs which have | 335 // Since sending this message will often fail (e.g. for new tabs which have |
| 336 // just been opened) we catch and ignore any exception thrown. | 336 // just been opened) we catch and ignore any exception thrown. |
| 337 browser.tabs.sendMessage( | 337 browser.tabs.sendMessage( |
| 338 page.id, {type: "composer.content.finished"} | 338 page.id, {type: "composer.content.finished"} |
| 339 ).catch(() => {}); | 339 ).catch(() => {}); |
| 340 }); | 340 }); |
| OLD | NEW |