LEFT | RIGHT |
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 exports = module.exports = { | 7 exports.addonName = {{ basename|json }}; |
8 addonName: {{ basename|json }}, | 8 exports.addonVersion = {{ version|json }}; |
9 addonVersion: {{ version|json }}, | |
10 | 9 |
11 application: "unknown", | 10 exports.application = "unknown"; |
12 applicationVersion: "0", | 11 exports.applicationVersion = "0"; |
13 | 12 |
14 platform: "gecko", | 13 exports.platform = "gecko"; |
15 platformVersion: "0" | 14 exports.platformVersion = "0"; |
16 }; | |
17 | 15 |
18 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); | 16 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
19 if (match) | 17 if (match) |
20 exports.platformVersion = match[1]; | 18 exports.platformVersion = match[1]; |
21 | 19 |
22 browser.runtime.getBrowserInfo().then(browserInfo => | 20 browser.runtime.getBrowserInfo().then(browserInfo => |
23 { | 21 { |
24 exports.application = browserInfo.name.toLowerCase(); | 22 exports.application = browserInfo.name.toLowerCase(); |
25 exports.applicationVersion = browserInfo.version; | 23 exports.applicationVersion = browserInfo.version; |
26 }); | 24 }); |
LEFT | RIGHT |