Skip to content

Commit

Permalink
Add detection of TikTok WebView
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirozha1337 authored and lbarthon committed Dec 5, 2024
1 parent c941f1d commit d4cde4c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ user_agent_parsers:
# Twitter
- regex: '(Twitter for (?:iPhone|iPad)|TwitterAndroid)(?:\/(\d+)\.(\d+)|)'
family_replacement: 'Twitter'
# TikTok
- regex: '(musical_ly) app_version\/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'TikTok'
- regex: '(musical_ly_)(\d+)\.(\d+)\.(\d+)'
family_replacement: 'TikTok'
- regex: '(BytedanceWebview)\/[a-z0-9]+'
family_replacement: 'TikTok'

# Phantom app
- regex: 'Mozilla.{1,200}Mobile.{1,100}(Phantom\/ios|Phantom\/android).(\d+)\.(\d+)\.(\d+)'
Expand Down
18 changes: 18 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7833,6 +7833,24 @@ test_cases:
minor: '0'
patch: '0'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Mobile/15E148 Safari/604.1 musical_ly_34.3.1 JsSdk/2.0 NetType/4G Channel/App Store ByteLocale/en Region/US isDarkMode/1 WKWebView/1 RevealType/Dialog'
family: 'TikTok'
major: '34'
minor: '3'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 10; moto g(7) Build/QP6_S30.52-23-13-4; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/108.0.5359.128 Mobile Safari/537.36 musical_ly_2022704050 JsSdk/1.0 NetType/WIFI Channel/googleplay AppName/musical_ly app_version/27.4.5 ByteLocale/en ByteFullLocale/en Region/US Spark/1.2.4-alpha.5 AppVersion/27.4.5 PIA/1.5.10 BytedanceWebview/d8a21c6'
family: 'TikTok'
major: '27'
minor: '4'
patch: '5'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 BytedanceWebview/d8a21c6 trill_34.9.0 JsSdk/2.0 NetType/4G Channel/App Store ByteLocale/en Region/MY FalconTag/31CFA6E0-CAE5-4ECF-A13A-ADFCAFC2428F'
family: 'TikTok'
major:
minor:
patch:

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 Flipboard/4.2.2'
family: 'Flipboard'
major: '4'
Expand Down

0 comments on commit d4cde4c

Please sign in to comment.