Skip to content

Commit 53d3853

Browse files
[WIP] Remove Edge from the default browser set
1 parent 31146ca commit 53d3853

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

webapp/components/product-info.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Use of this source code is governed by a BSD-style license that can be
44
* found in the LICENSE file.
55
*/
6+
67
const DisplayNames = (() => {
78
let m = new Map();
89
['chrome', 'chrome-experimental'].forEach(n => m.set(n, 'Chrome'));
@@ -42,7 +43,15 @@ const AllBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari', 's
4243
// The list of default browsers used in cases where the user has not otherwise
4344
// chosen a set of browsers (e.g. which browsers to show runs for). Stored as
4445
// an ordered list so that the first entry can be used as a consistent default.
45-
const DefaultBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari']);
46+
//
47+
// Historically Edge was included in the default browsers, but it was removed
48+
// to show only one browser per engine
49+
// (https://github.com/web-platform-tests/wpt.fyi/issues/1519). For user
50+
// convenience, there is a flag to include it in the default set again.
51+
const DefaultBrowserNames = edgeIsDefaultProduct()
52+
? Object.freeze(['chrome', 'edge', 'firefox', 'safari'])
53+
: Object.freeze(['chrome', 'firefox', 'safari']);
54+
console.log(DefaultBrowserNames);
4655
const DefaultProductSpecs = DefaultBrowserNames;
4756

4857
// The above sets, encoded as product objects. This avoids repeatedly calling
@@ -59,6 +68,17 @@ const SemanticLabels = [
5968
{ property: '_source', values: Sources },
6069
];
6170

71+
function edgeIsDefaultProduct() {
72+
// Preferably we would use the WPTFlags class here, but it expects to be a
73+
// super-class wrapping a Polymer element to work. Instead we use our
74+
// knowledge of its internal implementation to go straight to local storage.
75+
const value = localStorage.getItem('features.edgeIsDefaultProduct');
76+
console.log(value);
77+
console.log(value !== null);
78+
console.log(JSON.parse(value));
79+
return value !== null && JSON.parse(value);
80+
}
81+
6282
function parseProductSpec(spec) {
6383
// @sha (optional)
6484
let revision = '';

webapp/components/wpt-flags.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Object.defineProperty(wpt, 'ClientSideFeatures', {
2121
'colorHomepage',
2222
'diffFromAPI',
2323
'displayMetadata',
24+
'edgeIsDefaultProduct',
2425
'experimentalByDefault',
2526
'experimentalAligned',
2627
'experimentalAlignedExceptEdge',
@@ -183,6 +184,11 @@ class WPTFlagsEditor extends FlagsEditorClass(/*environmentFlags*/ false) {
183184
Use pass-rate colors on the homepage
184185
</paper-checkbox>
185186
</paper-item>
187+
<paper-item>
188+
<paper-checkbox checked="{{edgeIsDefaultProduct}}">
189+
Include Edge as part of the default product set.
190+
</paper-checkbox>
191+
</paper-item>
186192
<paper-item>
187193
<paper-checkbox checked="{{structuredQueries}}">
188194
Interpret query strings as structured queries over test names and test

0 commit comments

Comments
 (0)