resourceloader: Combine UC Mini startup regex with others
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 21 Nov 2016 23:02:06 +0000 (15:02 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 21 Nov 2016 23:04:11 +0000 (15:04 -0800)
Follows-up 2b1da77.

Also add "UC Mini" to the list of documented Grade C browsers,
and leave a note about regex combinations. (Follows-up 5d166eb).

Change-Id: I1b5307aec7fd1734d8a79a2256e061fceb20fa35

resources/src/startup.js

index 2050ca9..f9cfecf 100644 (file)
@@ -44,6 +44,7 @@ mwPerformance.mark( 'mwLoadStart' );
  * - Nokia's Ovi Browser
  * - MeeGo's browser
  * - Google Glass
+ * - UC Mini (speed mode on)
  *
  * Other browsers that pass the check are considered Grade X.
  *
@@ -66,11 +67,10 @@ function isCompatible( str ) {
 
                // Hardcoded exceptions for browsers that pass the requirement but we don't want to
                // support in the modern run-time.
+               // Note: Please extend the regex instead of adding new ones
                !(
-                       ua.match( /webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass/ ) ||
-                       ua.match( /PlayStation/i ) ||
-                       // UC Mini (speed mode on)
-                       ua.match( /^Mozilla\/5\.0 .+ Gecko\/$/ )
+                       ua.match( /webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$/ ) ||
+                       ua.match( /PlayStation/i )
                )
        );
 }