From 9dd76898da94079a54b9073b9d09a8026507cbdd Mon Sep 17 00:00:00 2001 From: Elliott Eggleston Date: Tue, 13 Dec 2016 14:48:18 -0600 Subject: [PATCH] Add googleweblight to JS blacklist 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 | 2 +- tests/qunit/suites/resources/startup.test.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/src/startup.js b/resources/src/startup.js index 82a00bc6e5..20818d2656 100644 --- a/resources/src/startup.js +++ b/resources/src/startup.js @@ -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 ) ) ); diff --git a/tests/qunit/suites/resources/startup.test.js b/tests/qunit/suites/resources/startup.test.js index 045b633695..e6e798b8ed 100644 --- a/tests/qunit/suites/resources/startup.test.js +++ b/tests/qunit/suites/resources/startup.test.js @@ -139,7 +139,9 @@ // 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' ] }; -- 2.20.1