From 77e0aa1ac67f5a875539b546bd2d1a5c962373b0 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Thu, 12 Oct 2023 14:18:51 +0700 Subject: [PATCH] Fix #563 #631 - Add new browser: Alipay --- src/main/ua-parser.js | 4 ++-- test/specs/browser-all.json | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/ua-parser.js b/src/main/ua-parser.js index bad1b7efe..5a1832fa6 100755 --- a/src/main/ua-parser.js +++ b/src/main/ua-parser.js @@ -360,12 +360,12 @@ // WebView /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android ], [[NAME, FACEBOOK], VERSION], [ - /(Klarna)\/([\w\.]+)/i // Klarna Shopping Browser for iOS & Android - ], [[NAME, KLARNA], VERSION], [ + /(Klarna)\/([\w\.]+)/i, // Klarna Shopping Browser for iOS & Android /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, // Kakao App /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, // Naver InApp /safari (line)\/([\w\.]+)/i, // Line App for iOS /\b(line)\/([\w\.]+)\/iab/i, // Line App for Android + /(alipay)client\/([\w\.]+)/i, // Alipay /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat ], [NAME, VERSION], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS diff --git a/test/specs/browser-all.json b/test/specs/browser-all.json index 9eaa4a020..826709ff7 100644 --- a/test/specs/browser-all.json +++ b/test/specs/browser-all.json @@ -9,6 +9,26 @@ "major" : "undefined" } }, + { + "desc" : "Alipay", + "ua" : "Mozilla/5.0 (Linux; U; Android 10; zh-CN; V2034A Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 UWS/3.22.2.33 Mobile Safari/537.36 UCBS/3.22.2.33_211025173018 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:WIFI,ws:360|0|2.0) AliApp(AP/10.2.51.7100) AlipayClient/10.2.51.7100 Language/zh-Hans useStatusBar/true isConcaveScreen/true Region/CNAriver/1.0.0", + "expect" : + { + "name" : "Alipay", + "version" : "10.2.51.7100", + "major" : "10" + } + }, + { + "desc" : "Alipay", + "ua" : "Mozilla/5.0 (Linux; Android 10; VOG-AL00 Build/HUAWEIVOG-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/105.0.5195.148 MYWeb/0.2.103.0_20230131112530 UWS/3.22.2.9999 UCBS/3.22.2.9999_220000000000 Mobile Safari/537.36 NebulaSDK/1.8.100112 Nebula AlipayDefined(nt:WIFI,ws:360|0|3.0) AliApp(AP/10.3.50.9999) AlipayClient/10.3.50.9999 Language/en isConcaveScreen/true Region/CN ProductType/devAriver/1.0.0", + "expect" : + { + "name" : "Alipay", + "version" : "10.3.50.9999", + "major" : "10" + } + }, { "desc" : "Android Browser on Galaxy Nexus", "ua" : "Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",