diff --git a/src/ua-parser.js b/src/ua-parser.js index d14fa70ba..9a70962f9 100755 --- a/src/ua-parser.js +++ b/src/ua-parser.js @@ -296,6 +296,8 @@ ], [NAME, VERSION], [ /\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS ], [VERSION, [NAME, 'GSA']], [ + /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok + ], [VERSION, [NAME, 'TikTok']], [ /headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless ], [VERSION, [NAME, CHROME+' Headless']], [ diff --git a/test/browser-test.json b/test/browser-test.json index 8e2f225ec..ff8d1e625 100644 --- a/test/browser-test.json +++ b/test/browser-test.json @@ -1692,5 +1692,32 @@ "version": "10.25.0", "major" : "10" } + }, + { + "desc" : "TikTok", + "ua" : "Mozilla/5.0 (Linux; Android 11; 21061119AG Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile Safari/537.36 trill_2022109040 JsSdk/1.0 NetType/MOBILE Channel/googleplay AppName/musical_ly app_version/21.9.4 ByteLocale/ru-RU ByteFullLocale/ru-RU Region/KG BytedanceWebview/d8a21c6", + "expect" : { + "name" : "TikTok", + "version": "21.9.4", + "major" : "21" + } + }, + { + "desc" : "TikTok", + "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 musical_ly_21.1.0 JsSdk/2.0 NetType/4G Channel/App Store ByteLocale/ru Region/RU ByteFullLocale/ru-RU isDarkMode/1 WKWebView/1 BytedanceWebview/d8a21c6", + "expect" : { + "name" : "TikTok", + "version": "21.1.0", + "major" : "21" + } + }, + { + "desc" : "TikTok", + "ua" : "Mozilla/5.0 (Linux; Android 10; STK-LX1 Build/HONORSTK-LX1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 musical_ly_2022803040 JsSdk/1.0 NetType/WIFI Channel/huaweiadsglobal_int AppName/musical_ly app_version/28.3.4 ByteLocale/en ByteFullLocale/en Region/IQ Spark/1.2.7-alpha.8 AppVersion/28.3.4 PIA/1.5.11 BytedanceWebview/d8a21c6", + "expect" : { + "name" : "TikTok", + "version": "28.3.4", + "major" : "28" + } } ]