Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 (function(global) | 18 (function(global) |
19 { | 19 { |
20 if (typeof ext == "undefined") | 20 if (!global.ext) |
Thomas Greiner
2015/01/07 12:19:55
Nit: To make it consistent with all other referenc
Sebastian Noack
2015/01/07 12:23:21
Why not just |"ext" in global| then?
Wladimir Palant
2015/01/07 16:33:10
Done.
| |
21 global.ext = require("ext_background"); | 21 global.ext = require("ext_background"); |
22 | 22 |
23 var Utils = require("utils").Utils; | 23 var Utils = require("utils").Utils; |
24 var FilterStorage = require("filterStorage").FilterStorage; | 24 var FilterStorage = require("filterStorage").FilterStorage; |
25 var FilterNotifier = require("filterNotifier").FilterNotifier; | 25 var FilterNotifier = require("filterNotifier").FilterNotifier; |
26 var defaultMatcher = require("matcher").defaultMatcher; | 26 var defaultMatcher = require("matcher").defaultMatcher; |
27 var BlockingFilter = require("filterClasses").BlockingFilter; | 27 var BlockingFilter = require("filterClasses").BlockingFilter; |
28 var Synchronizer = require("synchronizer").Synchronizer; | 28 var Synchronizer = require("synchronizer").Synchronizer; |
29 | 29 |
30 var subscriptionClasses = require("subscriptionClasses"); | 30 var subscriptionClasses = require("subscriptionClasses"); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 }); | 87 }); |
88 } | 88 } |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 global.ext.onMessage.addListener(function(message, sender, callback) | 92 global.ext.onMessage.addListener(function(message, sender, callback) |
93 { | 93 { |
94 switch (message.type) | 94 switch (message.type) |
95 { | 95 { |
96 case "app.get": | 96 case "app.get": |
97 if (message.what == "issues") | 97 if (message.what == "issues") |
Thomas Greiner
2015/01/07 12:19:55
There's quite a bunch of ifs now so please turn th
Wladimir Palant
2015/01/07 16:33:10
Quite frankly, I consider a nested switch statemen
Thomas Greiner
2015/01/07 17:31:38
Since for this particular case we're debating pers
Wladimir Palant
2015/01/07 19:03:39
While I am inclined to agree, this will unfortunat
| |
98 { | 98 { |
99 var info = require("info"); | 99 var info = require("info"); |
100 callback({ | 100 callback({ |
101 seenDataCorruption: "seenDataCorruption" in global ? global.seenData Corruption : false, | 101 seenDataCorruption: "seenDataCorruption" in global ? global.seenData Corruption : false, |
102 filterlistsReinitialized: "filterlistsReinitialized" in global ? glo bal.filterlistsReinitialized : false, | 102 filterlistsReinitialized: "filterlistsReinitialized" in global ? glo bal.filterlistsReinitialized : false, |
103 legacySafariVersion: (info.platform == "safari" && ( | 103 legacySafariVersion: (info.platform == "safari" && ( |
104 Services.vc.compare(info.platformVersion, "6.0") < 0 || // bef oreload breaks websites in Safari 5 | 104 Services.vc.compare(info.platformVersion, "6.0") < 0 || // bef oreload breaks websites in Safari 5 |
105 Services.vc.compare(info.platformVersion, "6.1") == 0 || // ext ensions are broken in 6.1 and 7.0 | 105 Services.vc.compare(info.platformVersion, "6.1") == 0 || // ext ensions are broken in 6.1 and 7.0 |
106 Services.vc.compare(info.platformVersion, "7.0") == 0)) | 106 Services.vc.compare(info.platformVersion, "7.0") == 0)) |
107 }); | 107 }); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 } | 173 } |
174 | 174 |
175 if (message.filter) | 175 if (message.filter) |
176 filters.subscription = message.filter; | 176 filters.subscription = message.filter; |
177 else | 177 else |
178 delete filters.subscription; | 178 delete filters.subscription; |
179 break; | 179 break; |
180 } | 180 } |
181 }); | 181 }); |
182 })(this); | 182 })(this); |
LEFT | RIGHT |