By default, `require('bowser')` requires the *ES5 version of files*, which
**do not** include any polyfills.
In case if you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills.
In case you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills.
So, for you it's suitable to require bowser like this: `require('bowser/bundled')`.
As the result, you get a ES5 version of bowser with `babel-polyfill` bundled together.
@ -37,7 +37,7 @@ You may need to use the source files, so they will be available in the package a
## Browser props detection
Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to make it with Bowser:
Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to do it with Bowser:
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
@ -2687,7 +2687,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
* const result = Bowser.parse(window.navigator.userAgent);
*/
static parse(UA) {
return (new Parser(UA)).getResult();
@ -102,7 +105,7 @@ export default Bowser;
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
@ -766,7 +766,7 @@ like <code>"iPhone"</code> or <code>"Kindle Fire HD 7"</code
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
<article><h2>Bowser</h2><p>A Browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms.</p>
<article><h2>Bowser</h2><p>A browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms.</p>
<h1>Overview</h1><p>The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers.</p>
<p><em>Please, note that this is an alpha version. Check out the <ahref="https://github.com/lancedikson/bowser/tree/v1.x">1.x</a> branch for a stable version.</em></p>
<p><strong>Changes of the 2.0</strong>
<p><strong>Changes of version 2.0</strong>
The upcoming 2.0 version has drastically changed API. All available methods can be found in the <code>docs</code> folder from now on and on a webpage soon.</p>
<h1>Use cases</h1><p>First of all, require the library:</p>
<preclass="prettyprint source lang-javascript"><code>const bowser = require('bowser');</code></pre><p>By default, <code>require('bowser')</code> requires the <em>ES5 version of files</em>, which
<strong>do not</strong> include any polyfills.</p>
<p>In case if you don't use your own <code>babel-polyfill</code> you may need to have pre-built bundle with all needed polyfills.
<p>In case you don't use your own <code>babel-polyfill</code> you may need to have pre-built bundle with all needed polyfills.
So, for you it's suitable to require bowser like this: <code>require('bowser/bundled')</code>.
As the result, you get a ES5 version of bowser with <code>babel-polyfill</code> bundled together.</p>
<p>You may need to use the source files, so they will be available in the package as well.</p>
<h2>Browser props detection</h2><p>Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to make it with Bowser:</p>
<h2>Browser props detection</h2><p>Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to do it with Bowser:</p>
console.log(`The current browser name is "${browser.getBrowserName()}"`);
@ -156,7 +156,7 @@ check if all tests are still passing.</p>
<brclass="clear">
<footer>
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Oct 19 2018 19:31:53 GMT+0200 (Central European Summer Time) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.