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

Side by Side Diff: templates/chromeInfo.js.tmpl

Issue 29454678: Issue 5085 - Add edgeInfo.js template for edge specific builds (Closed)
Patch Set: readd chrome logic, remove more chrome specific code from edge tmpl Created June 7, 2017, 1:08 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | templates/edgeInfo.js.tmpl » ('j') | templates/edgeInfo.js.tmpl » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 let platform = "chromium"; 7 let platform = "chromium";
8 let platformVersion = null; 8 let platformVersion = null;
9 let application = null; 9 let application = null;
10 let applicationVersion; 10 let applicationVersion;
11 11
12 let regexp = /(\S+)\/(\S+)(?:\s*\(.*?\))?/g; 12 let regexp = /(\S+)\/(\S+)(?:\s*\(.*?\))?/g;
13 let match; 13 let match;
14 14
15 while (match = regexp.exec(navigator.userAgent)) 15 while (match = regexp.exec(navigator.userAgent))
16 { 16 {
Sebastian Noack 2017/06/07 13:26:12 The "platform" variable defined above isn't necess
Jon Sonesen 2017/06/07 13:56:07 Acknowledged.
17 let app = match[1]; 17 let app = match[1];
18 let ver = match[2]; 18 let ver = match[2];
19 19
20 if (app == "Chrome") 20 if (app == "Chrome")
21 { 21 {
22 platformVersion = ver; 22 platformVersion = ver;
23 } 23 }
24 else if (app == "Edge")
25 {
26 platform = "edgehtml";
27 platformVersion = ver;
28 application = "edge";
29 applicationVersion = "0";
30 }
31 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari") 24 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari")
32 { 25 {
33 // For compatibility with legacy websites, Chrome's UA 26 // For compatibility with legacy websites, Chrome's UA
34 // also includes a Mozilla, AppleWebKit and Safari token. 27 // also includes a Mozilla, AppleWebKit and Safari token.
35 // Any further name/version pair indicates a fork. 28 // Any further name/version pair indicates a fork.
36 application = app == "OPR" ? "opera" : app.toLowerCase(); 29 application = app == "OPR" ? "opera" : app.toLowerCase();
37 applicationVersion = ver; 30 applicationVersion = ver;
38 } 31 }
39 } 32 }
40 33
(...skipping 13 matching lines...) Expand all
54 47
55 48
56 exports.addonName = {{ basename|json }}; 49 exports.addonName = {{ basename|json }};
57 exports.addonVersion = {{ version|json }}; 50 exports.addonVersion = {{ version|json }};
58 51
59 exports.application = application; 52 exports.application = application;
60 exports.applicationVersion = applicationVersion; 53 exports.applicationVersion = applicationVersion;
61 54
62 exports.platform = platform; 55 exports.platform = platform;
63 exports.platformVersion = platformVersion; 56 exports.platformVersion = platformVersion;
OLDNEW
« no previous file with comments | « no previous file | templates/edgeInfo.js.tmpl » ('j') | templates/edgeInfo.js.tmpl » ('J')

Powered by Google App Engine
This is Rietveld