Index: templates/geckoInfo.js.tmpl |
=================================================================== |
--- a/templates/geckoInfo.js.tmpl |
+++ b/templates/geckoInfo.js.tmpl |
@@ -12,13 +12,24 @@ |
exports.platform = "gecko"; |
exports.platformVersion = "0"; |
let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); |
if (match) |
exports.platformVersion = match[1]; |
-browser.runtime.getBrowserInfo().then(browserInfo => |
+// Firefox 50 does not support runtime.getBrowserInfo |
+if ("getBrowserInfo" in browser.runtime) |
{ |
- exports.application = browserInfo.name.toLowerCase(); |
- exports.applicationVersion = browserInfo.version; |
-}); |
+ browser.runtime.getBrowserInfo().then(browserInfo => |
+ { |
+ exports.application = browserInfo.name.toLowerCase(); |
+ exports.applicationVersion = browserInfo.version; |
+ }); |
+} |
+else |
+{ |
+ let browserInfo = /\bFirefox\/(\S+)/.exec(navigator.userAgent); |
+ exports.application = "firefox"; |
+ if (browserInfo) |
+ exports.applicationVersion = browserInfo[1]; |
+} |