Methods
(static) getParser(UA, skipParsingopt) → {Parser}
Creates a Parser instance
Example
const parser = Bowser.getParser(window.navigator.userAgent);
const result = parser.getResult();
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
UA |
String | UserAgent string |
||
skipParsing |
Boolean |
<optional> |
false
|
Will make the Parser postpone parsing until you ask it
explicitly. Same as |
Throws:
-
when UA is not a String
Returns:
- Type
- Parser
(static) parse(UA) → {ParsedResult}
Creates a Parser instance and runs Parser.getResult immediately
Example
const result = Bowser.parse(window.navigator.userAgent);
Parameters:
Name | Type | Description |
---|---|---|
UA |
Returns:
- Type
- ParsedResult