Left: | ||
Right: |
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 25 matching lines...) Expand all Loading... | |
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 port.on("types.get", (message, sender) => | 45 port.on("types.get", (message, sender) => |
46 Array.from(require("requestBlocker").filterTypes)); | 46 { |
Sebastian Noack
2017/09/05 18:12:14
I wonder whether it would be worth to make sure th
Thomas Greiner
2017/09/06 11:00:25
Good point. We're currently not imposing any order
Jon Sonesen
2017/09/06 13:12:15
What about removing the OTHER return from lib/requ
Sebastian Noack
2017/09/06 17:39:19
I don't think the order matters much, except for O
Jon Sonesen
2017/09/07 07:46:17
Yeah, I agree here. Will do.
Thomas Greiner
2017/09/12 13:06:16
Good point. In that case no objections from my end
| |
47 let filterTypes = Array.from(require("requestBlocker").filterTypes); | |
48 filterTypes.push(...filterTypes.splice(filterTypes.indexOf("OTHER"), 1)); | |
49 return filterTypes; | |
50 }); | |
47 | 51 |
48 // Some modules doesn't exist on Firefox. Moreover, | 52 // Some modules doesn't exist on Firefox. Moreover, |
49 // require() throws an exception on Firefox in that case. | 53 // require() throws an exception on Firefox in that case. |
50 // However, try/catch causes the whole function to to be | 54 // However, try/catch causes the whole function to to be |
51 // deoptimized on V8. So we wrap it into another function. | 55 // deoptimized on V8. So we wrap it into another function. |
52 function tryRequire(module) | 56 function tryRequire(module) |
53 { | 57 { |
54 try | 58 try |
55 { | 59 { |
56 return require(module); | 60 return require(module); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
437 if (message.url) | 441 if (message.url) |
438 subscriptions = [Subscription.fromURL(message.url)]; | 442 subscriptions = [Subscription.fromURL(message.url)]; |
439 | 443 |
440 for (let subscription of subscriptions) | 444 for (let subscription of subscriptions) |
441 { | 445 { |
442 if (subscription instanceof DownloadableSubscription) | 446 if (subscription instanceof DownloadableSubscription) |
443 Synchronizer.execute(subscription, true); | 447 Synchronizer.execute(subscription, true); |
444 } | 448 } |
445 }); | 449 }); |
446 })(this); | 450 })(this); |
LEFT | RIGHT |