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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 else if (message.what == "localeInfo") | 168 else if (message.what == "localeInfo") |
169 { | 169 { |
170 var bidiDir; | 170 var bidiDir; |
171 if ("chromeRegistry" in Utils) | 171 if ("chromeRegistry" in Utils) |
172 bidiDir = Utils.chromeRegistry.isLocaleRTL("adblockplus") ? "rtl" :
"ltr"; | 172 bidiDir = Utils.chromeRegistry.isLocaleRTL("adblockplus") ? "rtl" :
"ltr"; |
173 else | 173 else |
174 bidiDir = ext.i18n.getMessage("@@bidi_dir"); | 174 bidiDir = ext.i18n.getMessage("@@bidi_dir"); |
175 | 175 |
176 callback({locale: Utils.appLocale, bidiDir: bidiDir}); | 176 callback({locale: Utils.appLocale, bidiDir: bidiDir}); |
177 } | 177 } |
178 else if (message.what == "addonVersion") | |
179 { | |
180 callback(info.addonVersion); | |
181 } | |
182 else if (message.what == "features") | 178 else if (message.what == "features") |
183 { | 179 { |
184 callback({ | 180 callback({ |
185 devToolsPanel: info.platform == "chromium", | 181 devToolsPanel: info.platform == "chromium", |
186 safariContentBlocker: "safari" in global | 182 safariContentBlocker: "safari" in global |
187 && "extension" in global.safari | 183 && "extension" in global.safari |
188 && "setContentBlocker" in global.safari.extension | 184 && "setContentBlocker" in global.safari.extension |
189 }); | 185 }); |
190 } | 186 } |
191 else | 187 else |
192 callback(null); | 188 callback(info[message.what]); |
193 break; | 189 break; |
194 case "app.listen": | 190 case "app.listen": |
195 getListenerFilters(sender.page).app = message.filter; | 191 getListenerFilters(sender.page).app = message.filter; |
196 break; | 192 break; |
197 case "app.open": | 193 case "app.open": |
198 if (message.what == "options") | 194 if (message.what == "options") |
199 ext.showOptions(); | 195 ext.showOptions(); |
200 break; | 196 break; |
201 case "filters.add": | 197 case "filters.add": |
202 var result = require("filterValidation").parseFilter(message.text); | 198 var result = require("filterValidation").parseFilter(message.text); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (subscription instanceof DownloadableSubscription) | 395 if (subscription instanceof DownloadableSubscription) |
400 Synchronizer.execute(subscription, true); | 396 Synchronizer.execute(subscription, true); |
401 } | 397 } |
402 break; | 398 break; |
403 case "subscriptions.isDownloading": | 399 case "subscriptions.isDownloading": |
404 callback(Synchronizer.isExecuting(message.url)); | 400 callback(Synchronizer.isExecuting(message.url)); |
405 break; | 401 break; |
406 } | 402 } |
407 }); | 403 }); |
408 })(this); | 404 })(this); |
OLD | NEW |