| Left: | ||
| Right: |
| 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 (function() { |
| 8 var platform = "chromium"; | 8 var platform = "chromium"; |
| 9 var platformVersion = null; | 9 var platformVersion = null; |
| 10 var application = null; | 10 var application = null; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 { | 22 { |
| 23 platformVersion = ver; | 23 platformVersion = ver; |
| 24 } | 24 } |
| 25 else if (app == "Edge") | 25 else if (app == "Edge") |
| 26 { | 26 { |
| 27 platform = "edgehtml"; | 27 platform = "edgehtml"; |
| 28 platformVersion = ver; | 28 platformVersion = ver; |
| 29 application = "edge"; | 29 application = "edge"; |
| 30 applicationVersion = "0"; | 30 applicationVersion = "0"; |
| 31 } | 31 } |
| 32 else if (app == "Gecko" && typeof browser == "object" && | |
|
Sebastian Noack
2016/12/02 11:47:50
Sorry for the confusion, but I just realized, that
Wladimir Palant
2016/12/03 19:02:56
Done.
| |
| 33 browser.runtime && browser.runtime.getBrowserInfo) | |
| 34 { | |
| 35 platform = "gecko"; | |
| 36 match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); | |
| 37 if (match) | |
| 38 platformVersion = match[1]; | |
| 39 browser.runtime.getBrowserInfo().then(function(info) | |
| 40 { | |
| 41 require.scopes.info.application = info.name.toLowerCase(); | |
| 42 require.scopes.info.applicationVersion = info.version; | |
| 43 }); | |
| 44 } | |
| 32 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari") | 45 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari") |
| 33 { | 46 { |
| 34 // For compatibility with legacy websites, Chrome's UA | 47 // For compatibility with legacy websites, Chrome's UA |
| 35 // also includes a Mozilla, AppleWebKit and Safari token. | 48 // also includes a Mozilla, AppleWebKit and Safari token. |
| 36 // Any further name/version pair indicates a fork. | 49 // Any further name/version pair indicates a fork. |
| 37 application = app == "OPR" ? "opera" : app.toLowerCase(); | 50 application = app == "OPR" ? "opera" : app.toLowerCase(); |
| 38 applicationVersion = ver; | 51 applicationVersion = ver; |
| 39 } | 52 } |
| 40 } | 53 } |
| 41 | 54 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 57 addonName: {{ metadata.get('general', 'basename')|json }}, | 70 addonName: {{ metadata.get('general', 'basename')|json }}, |
| 58 addonVersion: {{ version|json }}, | 71 addonVersion: {{ version|json }}, |
| 59 | 72 |
| 60 application: application, | 73 application: application, |
| 61 applicationVersion: applicationVersion, | 74 applicationVersion: applicationVersion, |
| 62 | 75 |
| 63 platform: platform, | 76 platform: platform, |
| 64 platformVersion: platformVersion | 77 platformVersion: platformVersion |
| 65 }; | 78 }; |
| 66 })(); | 79 })(); |
| OLD | NEW |