| OLD | NEW |
| 1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 4 | 4 |
| 5 "use strict"; | 5 "use strict"; |
| 6 | 6 |
| 7 (function() { | 7 exports.addonName = {{ basename|json }}; |
| 8 let info = require.scopes.info = { | 8 exports.addonVersion = {{ version|json }}; |
| 9 addonName: {{ metadata.get('general', 'basename')|json }}, | |
| 10 addonVersion: {{ version|json }}, | |
| 11 | 9 |
| 12 application: "unknown", | 10 exports.application = "unknown"; |
| 13 applicationVersion: "0", | 11 exports.applicationVersion = "0"; |
| 14 | 12 |
| 15 platform: "gecko", | 13 exports.platform = "gecko"; |
| 16 platformVersion: "0" | 14 exports.platformVersion = "0"; |
| 17 }; | |
| 18 | 15 |
| 19 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); | 16 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
| 20 if (match) | 17 if (match) |
| 21 info.platformVersion = match[1]; | 18 exports.platformVersion = match[1]; |
| 22 | 19 |
| 23 browser.runtime.getBrowserInfo().then(function(browserInfo) | 20 browser.runtime.getBrowserInfo().then(browserInfo => |
| 24 { | 21 { |
| 25 info.application = browserInfo.name.toLowerCase(); | 22 exports.application = browserInfo.name.toLowerCase(); |
| 26 info.applicationVersion = browserInfo.version; | 23 exports.applicationVersion = browserInfo.version; |
| 27 }); | 24 }); |
| 28 })(); | |
| OLD | NEW |