Page MenuHomePhabricator

Add TikTok's in-app browser to ua-parser library
Closed, ResolvedPublic3 Estimated Story Points

Description

We currently use the ua-parser library to extract information from user-agent strings. The library does not detect TikTok's in-app browser even though it can be identified using the BytedanceWebview substring (as discussed in T324376).

We should update the upstream library to add the necessary regex and then update our local version to pick up the changes.

Event Timeline

Thanks for opening this! We probably want folks from TikTok to do this as they'll be aware of edge-cases etc. and maybe more likely to update if they make changes? There was an open issue for it from a few years back that I commented on too: https://github.com/ua-parser/uap-core/issues/511

@Maryana @MMiller_WMF I'm curious what your thoughts are regarding Isaac's comment above and this request to update the upstream ua-parser library?

• EChetty set the point value for this task to 3.Jan 17 2023, 11:42 AM

Another ping to @Maryana and @MMiller_WMF . Do you have opinions on asking the TikTok team vs parsing the user-agent string as is?

Following this as well. Do we still need Tiktok to weigh in on the UA edge cases for this to be unblocked?

Along with the above- is there a broader opportunity to update all known user agent strings and add new ones to ensure we are getting updated coverage of referrals from all new services (e.g. GPT and other AI folks, new search engines, Tiktok). Happy to file a request if so

I'm not sure who the right person to answer your questions is @Cpetrillo but I'll throw some thoughts in the ring.

Do we still need Tiktok to weigh in on the UA edge cases for this to be unblocked?

It's not necessarily blocked by TikTok though I assume their feedback would be beneficial in case there are user-agents that we weren't aware of. But also it looks like coincidentally that this is going to be merged shortly though so might not need any intervention: https://github.com/ua-parser/uap-core/pull/591

is there a broader opportunity to update all known user agent strings and add new ones to ensure we are getting updated coverage of referrals from all new services (e.g. GPT and other AI folks, new search engines, Tiktok).

We rely on this open project (ua-parser) so not sure if there are folks over there who are focused on this specific use-case. I think this would be a useful thing to contribute and I don't see Perplexity, OpenAI etc. in the code/issues/PRs so I don't think it's currently happening. That said, I'm not sure if there are reasons behind these gaps etc. so someone would want to open an issue probably and see if the maintainers over there have thoughts on adding them.

https://github.com/ua-parser/uap-core/pull/591 was merged 5 Dec 2024.

As of June 2025 it starts to appear in pageviews_daily (private dataset e.g. Turnilo or Hadoop): https://w.wiki/KEmm

Screenshot 2026-03-24.png (1,904×1,528 px, 167 KB)

As well as in public user agent reports (depends on the month, not always above the Redacted threshold): https://analytics.wikimedia.org/dashboards/browsers/#mobile-site-by-browser/browser-family-timeseries

Screenshot 2026-03-24.png (2,538×1,196 px, 193 KB)