We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While reading the 2.0.0-beta documentation here: https://docs.uaparser.js.org/v2/api/submodules/extensions/overview.html
I learned that the required way of combining multiple Extensions is like this:
const botAndCLIParser = new UAParser(userAgentString, { browser : [...Bots.browser, ...CLIs.browser] })
it would be so much intuitive and simple to use if the library supports simply this:
const botAndCLIParser = new UAParser(userAgentString, [Bots, CLIs])
as an example of how ugly it can get... I wanted to implement the parsing of all possible known user agents and my code ended up like this:
const uaParser = new UAParser(userAgent, { browser: [...Apps.browser, ...Bots.browser, ...CLIs.browser, ...Emails.browser, ...MediaPlayers.browser, ...Modules.browser], device: ExtraDevices.device }) const uaParams = uaParser.getResult()
when it could have been as intuitive and simple as this:
const uaParser = new UAParser(userAgent, [Apps, Bots, CLIs, Emails, ExtraDevices, MediaPlayers, Modules]) const uaParams = uaParser.getResult()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
While reading the 2.0.0-beta documentation here:
https://docs.uaparser.js.org/v2/api/submodules/extensions/overview.html
I learned that the required way of combining multiple Extensions is like this:
it would be so much intuitive and simple to use if the library supports simply this:
as an example of how ugly it can get...
I wanted to implement the parsing of all possible known user agents and my code ended up like this:
when it could have been as intuitive and simple as this:
The text was updated successfully, but these errors were encountered: