3
3
* Use of this source code is governed by a BSD-style license that can be
4
4
* found in the LICENSE file.
5
5
*/
6
+
6
7
const DisplayNames = ( ( ) => {
7
8
let m = new Map ( ) ;
8
9
[ 'chrome' , 'chrome-experimental' ] . forEach ( n => m . set ( n , 'Chrome' ) ) ;
@@ -42,7 +43,15 @@ const AllBrowserNames = Object.freeze(['chrome', 'edge', 'firefox', 'safari', 's
42
43
// The list of default browsers used in cases where the user has not otherwise
43
44
// chosen a set of browsers (e.g. which browsers to show runs for). Stored as
44
45
// 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 ) ;
46
55
const DefaultProductSpecs = DefaultBrowserNames ;
47
56
48
57
// The above sets, encoded as product objects. This avoids repeatedly calling
@@ -59,6 +68,17 @@ const SemanticLabels = [
59
68
{ property : '_source' , values : Sources } ,
60
69
] ;
61
70
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
+
62
82
function parseProductSpec ( spec ) {
63
83
// @sha (optional)
64
84
let revision = '' ;
0 commit comments