Left: | ||
Right: |
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("matcher"); | 22 const {defaultMatcher} = require("../adblockpluscore/lib/matcher"); |
23 const {RegExpFilter} = require("filterClasses"); | 23 const {RegExpFilter} = require("../adblockpluscore/lib/filterClasses"); |
24 const {FilterNotifier} = require("filterNotifier"); | 24 const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
25 const {Prefs} = require("prefs"); | 25 const {Prefs} = require("./prefs"); |
26 const {extractHostFromFrame, stringifyURL, isThirdParty} = require("url"); | 26 const {extractHostFromFrame, stringifyURL, 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("info"); | 29 const info = require("../buildtools/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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 { | 280 { |
281 sender.page.sendMessage({ | 281 sender.page.sendMessage({ |
282 type: "composer.content.dialogClosed", | 282 type: "composer.content.dialogClosed", |
283 popupId: popupPageId | 283 popupId: popupPageId |
284 }); | 284 }); |
285 browser.tabs.onRemoved.removeListener(onRemoved); | 285 browser.tabs.onRemoved.removeListener(onRemoved); |
286 } | 286 } |
287 }; | 287 }; |
288 browser.tabs.onRemoved.addListener(onRemoved); | 288 browser.tabs.onRemoved.addListener(onRemoved); |
289 | 289 |
290 if (require("info").application == "firefox" && | 290 if (info.application == "firefox" && |
kzar
2018/03/28 13:50:33
You tested this code (the block element tool) stil
Jon Sonesen
2018/03/30 03:09:55
Oh man, well I had tested it but got the block ele
kzar
2018/04/03 12:08:57
Doing `info.application` doesn't work then? (Seems
| |
291 navigator.oscpu.startsWith("Linux")) | 291 navigator.oscpu.startsWith("Linux")) |
292 { | 292 { |
293 // Work around https://bugzil.la/1408446 | 293 // Work around https://bugzil.la/1408446 |
294 browser.windows.update(window.id, {width: window.width + 1}); | 294 browser.windows.update(window.id, {width: window.width + 1}); |
295 } | 295 } |
296 return popupPageId; | 296 return popupPageId; |
297 }); | 297 }); |
298 }); | 298 }); |
299 | 299 |
300 port.on("composer.getFilters", (message, sender) => | 300 port.on("composer.getFilters", (message, sender) => |
(...skipping 22 matching lines...) Expand all Loading... | |
323 // When tabs start loading we send them a message to ensure that the state | 323 // When tabs start loading we send them a message to ensure that the state |
324 // of the "block element" tool is reset. This is necessary since Firefox will | 324 // of the "block element" tool is reset. This is necessary since Firefox will |
325 // sometimes cache the state of a tab when the user navigates back / forward, | 325 // sometimes cache the state of a tab when the user navigates back / forward, |
326 // which includes the state of the "block element" tool. | 326 // which includes the state of the "block element" tool. |
327 // Since sending this message will often fail (e.g. for new tabs which have | 327 // Since sending this message will often fail (e.g. for new tabs which have |
328 // just been opened) we catch and ignore any exception thrown. | 328 // just been opened) we catch and ignore any exception thrown. |
329 browser.tabs.sendMessage( | 329 browser.tabs.sendMessage( |
330 page.id, {type: "composer.content.finished"} | 330 page.id, {type: "composer.content.finished"} |
331 ).catch(() => {}); | 331 ).catch(() => {}); |
332 }); | 332 }); |
OLD | NEW |