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

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

Issue 29365583: Issue 4670 - Add a new build type for Gecko-based WebExtensions (Closed) Base URL: https://hg.adblockplus.org/buildtools
Patch Set: Fixed application info Created Nov. 30, 2016, 12:21 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 | « packagerChrome.py ('k') | templates/manifest.json.tmpl » ('j') | no next file with comments »
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 (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
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")
33 {
34 platform = "gecko";
35 match = /\brv:(\d+(?:\.\d+)?)\b/.exec(navigator.userAgent);
36 if (match)
37 platformVersion = match[1];
38 browser.runtime.getBrowserInfo().then(function(info)
39 {
40 require.scopes.info.application = info.name.toLowerCase();
41 require.scopes.info.applicationVersion = info.version;
42 });
43 }
32 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari") 44 else if (app != "Mozilla" && app != "AppleWebKit" && app != "Safari")
33 { 45 {
34 // For compatibility with legacy websites, Chrome's UA 46 // For compatibility with legacy websites, Chrome's UA
35 // also includes a Mozilla, AppleWebKit and Safari token. 47 // also includes a Mozilla, AppleWebKit and Safari token.
36 // Any further name/version pair indicates a fork. 48 // Any further name/version pair indicates a fork.
37 application = app == "OPR" ? "opera" : app.toLowerCase(); 49 application = app == "OPR" ? "opera" : app.toLowerCase();
38 applicationVersion = ver; 50 applicationVersion = ver;
39 } 51 }
40 } 52 }
41 53
(...skipping 15 matching lines...) Expand all
57 addonName: {{ metadata.get('general', 'basename')|json }}, 69 addonName: {{ metadata.get('general', 'basename')|json }},
58 addonVersion: {{ version|json }}, 70 addonVersion: {{ version|json }},
59 71
60 application: application, 72 application: application,
61 applicationVersion: applicationVersion, 73 applicationVersion: applicationVersion,
62 74
63 platform: platform, 75 platform: platform,
64 platformVersion: platformVersion 76 platformVersion: platformVersion
65 }; 77 };
66 })(); 78 })();
OLDNEW
« no previous file with comments | « packagerChrome.py ('k') | templates/manifest.json.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld