From: Alex Monk Date: Mon, 3 Feb 2014 19:53:36 +0000 (+0000) Subject: jquery.client: Recognise Amazon Silk browser X-Git-Tag: 1.31.0-rc.0~16975^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=45192156d74593902c6249ae8a0212ae54162a87;p=lhc%2Fweb%2Fwiklou.git jquery.client: Recognise Amazon Silk browser Bug: 50777 Change-Id: I853e886188d5b87de429bff176a8967f45268e98 --- diff --git a/resources/jquery/jquery.client.js b/resources/jquery/jquery.client.js index 935aa4a420..4c6a7ac6b1 100644 --- a/resources/jquery/jquery.client.js +++ b/resources/jquery/jquery.client.js @@ -173,6 +173,13 @@ version = match[1]; } } + // And Amazon Silk's lies about being Android on mobile or Safari on desktop + if ( match = ua.match( /\bsilk\/([0-9.\-_]*)/ ) ) { + if ( match[1] ) { + name = 'silk'; + version = match[1]; + } + } versionNumber = parseFloat( version, 10 ) || 0.0; diff --git a/tests/qunit/suites/resources/jquery/jquery.client.test.js b/tests/qunit/suites/resources/jquery/jquery.client.test.js index 6030206b5f..df800bc251 100644 --- a/tests/qunit/suites/resources/jquery/jquery.client.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.client.test.js @@ -437,6 +437,41 @@ ltr: true, rtl: true } + }, + // Amazon Silk + 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true': { + title: 'Silk', + platform: 'Desktop', + profile: { + name: 'silk', + layout: 'webkit', + layoutVersion: 533, + platform: 'unknown', + version: '1.0.13.81_10003810', + versionBase: '1', + versionNumber: 1 + }, + wikiEditor: { + ltr: true, + rtl: true + } + }, + 'Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19 Silk-Accelerated=true': { + title: 'Silk', + platform: 'Mobile', + profile: { + name: 'silk', + layout: 'webkit', + layoutVersion: 535, + platform: 'unknown', + version: '2.1', + versionBase: '2', + versionNumber: 2.1 + }, + wikiEditor: { + ltr: true, + rtl: true + } } }, testMap = {