Add googleweblight to JS blacklist
authorElliott Eggleston <ejegg@ejegg.com>
Tue, 13 Dec 2016 20:48:18 +0000 (14:48 -0600)
committerElliott Eggleston <ejegg@ejegg.com>
Tue, 13 Dec 2016 23:35:01 +0000 (17:35 -0600)
Google runs JS on their proxy servers and outputs a page which may
be broken in creative ways (e.g. clicking anywhere triggers the
fundraising banner). Treat them as a non-JS browser to minimize
bugginess.

Currently broken with CentralNotice banner:
https://googleweblight.com/?lite_url=https://en.wikipedia.org

Images below the fold never load:
https://googleweblight.com/?lite_url=https://en.wikipedia.org/wiki/Barack_Obama

Bug: T152602
Change-Id: Ia277ab51634b770a950616a842bedb29fcbf1f12

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

index 82a00bc..20818d2 100644 (file)
@@ -75,7 +75,7 @@ function isCompatible( str ) {
                // 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|^Mozilla\/5\.0 .+ Gecko\/$/ ) ||
+                       ua.match( /webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight/ ) ||
                        ua.match( /PlayStation/i )
                )
        );
index 045b633..e6e798b 100644 (file)
                        // MeeGo
                        'Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13',
                        // UC Mini (speed mode on)
-                       'Mozilla/5.0 (X11; U; Linux i686; zh-CN; r:1.2.3.4) Gecko/'
+                       'Mozilla/5.0 (X11; U; Linux i686; zh-CN; r:1.2.3.4) Gecko/',
+                       // Google Web Light proxy
+                       'Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko; googleweblight) Chrome/38.0.1025.166 Mobile Safari/535.19'
                ]
        };