Skip to content

Commit 1696b87

Browse files
authored
Improve existing browser detection for Tiktok (#817)
* Improve browser detection: Tiktok * remove .mjs files changes
1 parent 7bc177d commit 1696b87

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/ua-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@
453453
], [NAME, VERSION, [TYPE, INAPP]], [
454454
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
455455
], [VERSION, [NAME, 'GSA'], [TYPE, INAPP]], [
456-
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
456+
/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
457457
], [VERSION, [NAME, 'TikTok'], [TYPE, INAPP]], [
458458
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android
459459
], [NAME, [TYPE, INAPP]], [

test/data/ua/browser/browser-all.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,16 @@
27422742
"major" : "28",
27432743
"type" : "inapp"
27442744
}
2745+
},
2746+
{
2747+
"desc" : "TikTok",
2748+
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/604.1 trill_43.0.0 BytedanceWebview/d8a21c6",
2749+
"expect" : {
2750+
"name" : "TikTok",
2751+
"version": "43.0.0",
2752+
"major" : "43",
2753+
"type" : "inapp"
2754+
}
27452755
},
27462756
{
27472757
"desc" : "Chrome Mobile",

0 commit comments

Comments
 (0)