| 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"; | |
| 6 | |
| 7 let platformVersion = null; | 5 let platformVersion = null; |
| 8 let application = null; | 6 let application = null; |
| 9 let applicationVersion; | 7 let applicationVersion; |
| 10 | 8 |
| 11 let regexp = /(\S+)\/(\S+)(?:\s*\(.*?\))?/g; | 9 let regexp = /(\S+)\/(\S+)(?:\s*\(.*?\))?/g; |
| 12 let match; | 10 let match; |
| 13 | 11 |
| 14 while (match = regexp.exec(navigator.userAgent)) | 12 while (match = regexp.exec(navigator.userAgent)) |
| 15 { | 13 { |
| 16 let app = match[1]; | 14 let app = match[1]; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 applicationVersion = platformVersion = "0"; | 35 applicationVersion = platformVersion = "0"; |
| 38 } | 36 } |
| 39 | 37 |
| 40 // no additional name/version, so this is upstream Chrome | 38 // no additional name/version, so this is upstream Chrome |
| 41 if (!application) | 39 if (!application) |
| 42 { | 40 { |
| 43 application = "chrome"; | 41 application = "chrome"; |
| 44 applicationVersion = platformVersion; | 42 applicationVersion = platformVersion; |
| 45 } | 43 } |
| 46 | 44 |
| 47 | |
| 48 exports.addonName = {{ basename|json }}; | |
| 49 exports.addonVersion = {{ version|json }}; | |
| 50 | |
| 51 exports.application = application; | 45 exports.application = application; |
| 52 exports.applicationVersion = applicationVersion; | 46 exports.applicationVersion = applicationVersion; |
| 53 | 47 |
| 54 exports.platform = "chromium"; | 48 exports.platform = "chromium"; |
| 55 exports.platformVersion = platformVersion; | 49 exports.platformVersion = platformVersion; |
| OLD | NEW |