Blacklist Google Glass web browser from JS
authorBrion Vibber <brion@pobox.com>
Wed, 11 Dec 2013 19:11:08 +0000 (11:11 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 11 Dec 2013 19:25:05 +0000 (11:25 -0800)
This will prevent things like collapsing sections on the Google Glass
web browser, and other interactive extras that really don't work well
on the limited UI (although the browser supports JS the interaction
model doesn't let you do much usefully, so a static page is better).

bug: 56008
Change-Id: I406d8131d4a8b3b98328e6c624433b67a18db645

resources/startup.js
tests/qunit/suites/resources/startup.test.js

index 6aba2f9..f139570 100644 (file)
@@ -41,7 +41,9 @@ function isCompatible( ua ) {
                // Opera Mini, all versions
                ua.match( /Opera Mini/ ) ||
                // Nokia's Ovi Browser
-               ua.match( /S40OviBrowser/ )
+               ua.match( /S40OviBrowser/ ) ||
+               // Google Glass browser groks JS but UI is too limited
+               ( ua.match( /Glass/ ) && ua.match( /Android/ ) )
        );
 }
 
index 76f32f7..8fd789a 100644 (file)
@@ -71,7 +71,9 @@
                        'Opera/9.80 (Android; Opera Mini/7.29530/27.1407; U; en) Presto/2.8.119 Version/11.10',
                        // Ovi Browser
                        'Mozilla/5.0 (Series40; NokiaX3-02/05.60; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.2.0.0.6',
-                       'Mozilla/5.0 (Series40; Nokia305/05.92; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.7.0.0.11'
+                       'Mozilla/5.0 (Series40; Nokia305/05.92; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.7.0.0.11',
+                       // Google Glass
+                       'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
                ],
                // No explicit support for or against these browsers, they're
                // given a shot at Grade A at their own risk.