From: Brion Vibber Date: Wed, 11 Dec 2013 19:11:08 +0000 (-0800) Subject: Blacklist Google Glass web browser from JS X-Git-Tag: 1.31.0-rc.0~17645^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=97776eedc5367f87590c4a9292c760391a9f987a;p=lhc%2Fweb%2Fwiklou.git Blacklist Google Glass web browser from JS 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 --- diff --git a/resources/startup.js b/resources/startup.js index 6aba2f9b06..f139570565 100644 --- a/resources/startup.js +++ b/resources/startup.js @@ -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/ ) ) ); } diff --git a/tests/qunit/suites/resources/startup.test.js b/tests/qunit/suites/resources/startup.test.js index 76f32f7e6e..8fd789a52c 100644 --- a/tests/qunit/suites/resources/startup.test.js +++ b/tests/qunit/suites/resources/startup.test.js @@ -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.