Index: templates/geckoInfo.js.tmpl |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/templates/geckoInfo.js.tmpl |
@@ -0,0 +1,28 @@ |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
+ |
+"use strict"; |
+ |
+(function() { |
+ let info = require.scopes.info = { |
+ addonName: {{ metadata.get('general', 'basename')|json }}, |
+ addonVersion: {{ version|json }}, |
+ |
+ application: "unknown", |
+ applicationVersion: "0", |
+ |
+ platform: "gecko", |
+ platformVersion: "0" |
+ }; |
+ |
+ let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
+ if (match) |
+ info.platformVersion = match[1]; |
+ |
+ browser.runtime.getBrowserInfo().then(function(browserInfo) |
+ { |
+ info.application = browserInfo.name.toLowerCase(); |
+ info.applicationVersion = browserInfo.version; |
+ }); |
+})(); |