Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve user agent detection (#1038)
A user reports that they had significantly more matches on "desktop" as a type than "mobile" as a type after moving from another provider. See https://posthoghelp.zendesk.com/agent/tickets/10775 We default to "desktop" for user agents we can't identify so this points at their user base having a high proportion of useragents we don't match They're on an older version of posthog-js that doesn't report raw user agent so we can't confirm that guess Until they update we can target general improvements This PR copies opensource test cases from other user agent matcher and uses them to improve our matching. In this change we: * don't try to attempt to start matching smart tvs * improve matching for OS and device * add matching for watchOS * adds ~1.1k rather than the 6k of ua-parser-js * pre-uglify the code to help roll-up minify it more by making many constants for repeated strings and using old fashioned concatenation to concat them together
- Loading branch information