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 24 matching lines...) Expand all Loading... |
35 const {Filter, BlockingFilter, RegExpFilter} = require("filterClasses"); | 35 const {Filter, BlockingFilter, RegExpFilter} = require("filterClasses"); |
36 const {Synchronizer} = require("synchronizer"); | 36 const {Synchronizer} = require("synchronizer"); |
37 | 37 |
38 const info = require("info"); | 38 const info = require("info"); |
39 const { | 39 const { |
40 Subscription, | 40 Subscription, |
41 DownloadableSubscription, | 41 DownloadableSubscription, |
42 SpecialSubscription | 42 SpecialSubscription |
43 } = require("subscriptionClasses"); | 43 } = require("subscriptionClasses"); |
44 | 44 |
| 45 const {Services} = Cu.import("resource://gre/modules/Services.jsm"); |
| 46 |
45 // Some modules doesn't exist on Firefox. Moreover, | 47 // Some modules doesn't exist on Firefox. Moreover, |
46 // require() throws an exception on Firefox in that case. | 48 // require() throws an exception on Firefox in that case. |
47 // However, try/catch causes the whole function to to be | 49 // However, try/catch causes the whole function to to be |
48 // deoptimized on V8. So we wrap it into another function. | 50 // deoptimized on V8. So we wrap it into another function. |
49 function tryRequire(module) | 51 function tryRequire(module) |
50 { | 52 { |
51 try | 53 try |
52 { | 54 { |
53 return require(module); | 55 return require(module); |
54 } | 56 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 179 } |
178 else | 180 else |
179 bidiDir = Utils.readingDirection; | 181 bidiDir = Utils.readingDirection; |
180 | 182 |
181 return {locale: Utils.appLocale, bidiDir}; | 183 return {locale: Utils.appLocale, bidiDir}; |
182 } | 184 } |
183 | 185 |
184 if (message.what == "features") | 186 if (message.what == "features") |
185 { | 187 { |
186 return { | 188 return { |
187 devToolsPanel: info.platform == "chromium" | 189 devToolsPanel: info.platform == "chromium" || |
| 190 info.application == "firefox" && |
| 191 Services.vc.compare(info.applicationVersion, "54") >= 0 |
188 }; | 192 }; |
189 } | 193 } |
190 | 194 |
191 return info[message.what]; | 195 return info[message.what]; |
192 }); | 196 }); |
193 | 197 |
194 port.on("app.listen", (message, sender) => | 198 port.on("app.listen", (message, sender) => |
195 { | 199 { |
196 getListenerFilters(sender.page).app = message.filter; | 200 getListenerFilters(sender.page).app = message.filter; |
197 }); | 201 }); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (message.url) | 438 if (message.url) |
435 subscriptions = [Subscription.fromURL(message.url)]; | 439 subscriptions = [Subscription.fromURL(message.url)]; |
436 | 440 |
437 for (let subscription of subscriptions) | 441 for (let subscription of subscriptions) |
438 { | 442 { |
439 if (subscription instanceof DownloadableSubscription) | 443 if (subscription instanceof DownloadableSubscription) |
440 Synchronizer.execute(subscription, true); | 444 Synchronizer.execute(subscription, true); |
441 } | 445 } |
442 }); | 446 }); |
443 })(this); | 447 })(this); |
OLD | NEW |