-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support more browsers #28
Comments
Hello, Package focus more on most common browsers, but its "best guess" approach detects most of the browsers correctly, for example Coc Coc browser will be detected as coc_coc_browser from the User Agent string. But yes, it is possible to put all the browsers from the list into the test and make it all work correctly if there are some issues. |
Here's a snippet from a js library that does very similar thing. https://github.com/DamonOehlman/detect-browser/blob/master/src/index.ts#L67 They took the approach of |
Yes, |
They're pretty fast if compiled. Heavy string contains matching can sometimes be more expensive. I benchmarked alternatives here and the regex-based solution with much more coverage ended up being on par with this library. Maybe there might be some easy wins to improve the performance by reducing the number of allocs because there are a lot that happen in this library. |
I will take a look, but overall footprint is very small, I run this on web sites and services with millions of daily page views and never had any issue with it. Sometimes people overreacts by looking at benchmarks and then they use the package for the service with total of 100 users. Sure, if you are fortunate enough to work on services with billions requests, you should pick the fastest package. |
Hi bro, you are doing well, and thank you for your contribution.
Currently, this library supports a few common browsers. Can we add more browsers to make the parse function more exactly?
We have a list of 272 browsers with user agent examples from this link: https://user-agents.net/browsers
For example: Coc Coc Browser
Javascript package: https://github.com/faisalman/ua-parser-js/tree/master
The text was updated successfully, but these errors were encountered: