Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: templates/geckoInfo.js.tmpl

Issue 29399569: Issue 5060 - Move require into modules template, make info a module (Closed)
Left Patch Set: Don't redeclare require Created March 31, 2017, 6:48 a.m.
Right Patch Set: Improve check for require Created April 1, 2017, 1:27 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 exports = module.exports = { 7 exports.addonName = {{ basename|json }};
8 addonName: {{ basename|json }}, 8 exports.addonVersion = {{ version|json }};
9 addonVersion: {{ version|json }},
10 9
11 application: "unknown", 10 exports.application = "unknown";
12 applicationVersion: "0", 11 exports.applicationVersion = "0";
13 12
14 platform: "gecko", 13 exports.platform = "gecko";
15 platformVersion: "0" 14 exports.platformVersion = "0";
16 };
17 15
18 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent); 16 let match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent);
19 if (match) 17 if (match)
20 exports.platformVersion = match[1]; 18 exports.platformVersion = match[1];
21 19
22 browser.runtime.getBrowserInfo().then(browserInfo => 20 browser.runtime.getBrowserInfo().then(browserInfo =>
23 { 21 {
24 exports.application = browserInfo.name.toLowerCase(); 22 exports.application = browserInfo.name.toLowerCase();
25 exports.applicationVersion = browserInfo.version; 23 exports.applicationVersion = browserInfo.version;
26 }); 24 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld