Index: templates/geckoInfo.js.tmpl |
diff --git a/templates/geckoInfo.js.tmpl b/templates/geckoInfo.js.tmpl |
index 0779ee226a22c555027f3bb7e79eddacb9301bbc..226bc677e5371361bf10d62124bd71d214ba4cbe 100644 |
--- a/templates/geckoInfo.js.tmpl |
+++ b/templates/geckoInfo.js.tmpl |
@@ -4,25 +4,23 @@ |
"use strict"; |
-(function() { |
- let info = require.scopes.info = { |
- addonName: {{ metadata.get('general', 'basename')|json }}, |
- addonVersion: {{ version|json }}, |
+exports = module.exports = { |
+ addonName: {{ basename|json }}, |
+ addonVersion: {{ version|json }}, |
- application: "unknown", |
- applicationVersion: "0", |
+ application: "unknown", |
+ applicationVersion: "0", |
- platform: "gecko", |
- platformVersion: "0" |
- }; |
+ platform: "gecko", |
+ platformVersion: "0" |
+}; |
- let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
- if (match) |
- info.platformVersion = match[1]; |
+let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
+if (match) |
+ exports.platformVersion = match[1]; |
- browser.runtime.getBrowserInfo().then(function(browserInfo) |
- { |
- info.application = browserInfo.name.toLowerCase(); |
- info.applicationVersion = browserInfo.version; |
- }); |
-})(); |
+browser.runtime.getBrowserInfo().then(browserInfo => |
+{ |
+ exports.application = browserInfo.name.toLowerCase(); |
+ exports.applicationVersion = browserInfo.version; |
+}); |