mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Merge tag 'release/2.5.0'
2.5.0 release/2.5.0
This commit is contained in:
commit
b16fc7135f
@ -1,5 +1,11 @@
|
||||
# Bowser Changelog
|
||||
|
||||
### 2.5.0 (July 16, 2019)
|
||||
- [ADD] Add constant output so that users can quickly get all types (#325)
|
||||
- [FIX] Add support for Roku OS (#332)
|
||||
- [FIX] Update devDependencies
|
||||
- [FIX] Fix docs, README and added funding information
|
||||
|
||||
### 2.4.0 (May 3, 2019)
|
||||
- [FIX] Update regexp for generic browsers (#310)
|
||||
- [FIX] Fix issues with module.exports (#318)
|
||||
|
116
docs/Bowser.html
116
docs/Bowser.html
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -47,108 +48,20 @@
|
||||
Bowser
|
||||
</h2>
|
||||
|
||||
<div class="class-description"><p>Bowser class.
|
||||
Keep it simple as much as it can be.
|
||||
It's supposed to work with collections of <a href="Parser.html">Parser</a> instances
|
||||
rather then solve one-instance problems.
|
||||
All the one-instance stuff is located in Parser class.</p></div>
|
||||
<div class="class-description"><p>Bowser is a static object, that provides an API to the Parsers</p></div>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructor</h2>
|
||||
|
||||
|
||||
<h4 class="name" id="Bowser"><span class="type-signature"></span>new Bowser<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line16">line 16</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -177,7 +90,7 @@ All the one-instance stuff is located in Parser class.</p></div>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line29">line 29</a>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line51">line 51</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -217,7 +130,7 @@ All the one-instance stuff is located in Parser class.</p></div>
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Creates a module:parser:Parser instance</p>
|
||||
<p>Creates a <a href="Parser.html">Parser</a> instance</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -332,7 +245,8 @@ const result = parser.getResult();</code></pre>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="description last"><p>same as skipParsing for <a href="Parser.html">Parser</a></p></td>
|
||||
<td class="description last"><p>Will make the Parser postpone parsing until you ask it
|
||||
explicitly. Same as <code>skipParsing</code> for <a href="Parser.html">Parser</a>.</p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@ -350,6 +264,8 @@ const result = parser.getResult();</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Throws:</h5>
|
||||
|
||||
|
||||
@ -368,7 +284,7 @@ const result = parser.getResult();</code></pre>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">Error</span>
|
||||
<span class="param-type"><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></span>
|
||||
|
||||
|
||||
</dd>
|
||||
@ -401,6 +317,7 @@ const result = parser.getResult();</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -418,7 +335,7 @@ const result = parser.getResult();</code></pre>
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line45">line 45</a>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line67">line 67</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -532,6 +449,8 @@ const result = parser.getResult();</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -552,6 +471,7 @@ const result = parser.getResult();</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -572,12 +492,14 @@ const result = parser.getResult();</code></pre>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
234
docs/BowserUAIsNotAStringError.html
Normal file
234
docs/BowserUAIsNotAStringError.html
Normal file
@ -0,0 +1,234 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>BowserUAIsNotAStringError - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
||||
<label for="nav-trigger" class="navicon-button x">
|
||||
<div class="navicon"></div>
|
||||
</label>
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<h1 class="page-title">BowserUAIsNotAStringError</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
|
||||
<header>
|
||||
|
||||
<h2>
|
||||
BowserUAIsNotAStringError
|
||||
</h2>
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<article>
|
||||
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="BowserUAIsNotAStringError"><span class="type-signature"></span>new BowserUAIsNotAStringError<span class="signature">()</span><span class="type-signature"></span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="bowser.js.html">bowser.js</a>, <a href="bowser.js.html#line20">line 20</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
<h5 class="subsection-title">Properties:</h5>
|
||||
|
||||
|
||||
|
||||
<table class="props">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>name</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -74,7 +75,7 @@
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line10">line 10</a>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line23">line 23</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -247,6 +248,9 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -256,6 +260,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -345,6 +351,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -368,6 +376,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -447,6 +456,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -474,6 +485,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -553,6 +565,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -580,6 +594,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -659,6 +674,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -682,6 +699,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -761,6 +779,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -788,6 +808,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -879,6 +900,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -899,6 +922,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1042,6 +1066,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -1066,6 +1092,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1145,6 +1172,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1172,6 +1201,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1251,6 +1281,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1274,6 +1306,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1425,6 +1458,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -1445,6 +1480,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1524,6 +1560,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1547,6 +1585,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1626,6 +1665,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1653,6 +1694,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1670,7 +1712,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line477">line 477</a>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line476">line 476</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -1785,6 +1827,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -1805,6 +1849,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1981,6 +2026,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -2001,6 +2048,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2081,6 +2129,9 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2164,6 +2215,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2187,6 +2240,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2266,6 +2320,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2289,6 +2345,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2368,6 +2425,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2394,6 +2453,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2473,6 +2533,8 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2496,6 +2558,7 @@ the OS called "anything" or the platform called "anything"</
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2639,6 +2702,8 @@ and should have browsers specs on the bottom-laying layer</p></td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -2667,6 +2732,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2684,7 +2750,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line486">line 486</a>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line485">line 485</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -2798,6 +2864,8 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -2818,6 +2886,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2949,6 +3018,8 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -2969,6 +3040,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2989,12 +3061,14 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -45,9 +46,26 @@
|
||||
* Bowser - a browser detector
|
||||
* https://github.com/lancedikson/bowser
|
||||
* MIT License | (c) Dustin Diaz 2012-2015
|
||||
* MIT License | (c) Denis Demchenko 2015-2017
|
||||
* MIT License | (c) Denis Demchenko 2015-2019
|
||||
*/
|
||||
import Parser from './parser.js';
|
||||
import {
|
||||
BROWSER_MAP,
|
||||
ENGINE_MAP,
|
||||
OS_MAP,
|
||||
PLATFORMS_MAP,
|
||||
} from './constants.js';
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @property name
|
||||
*/
|
||||
class BowserUAIsNotAStringError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = 'BowserUAIsNotAStringError';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bowser class.
|
||||
@ -55,15 +73,20 @@ import Parser from './parser.js';
|
||||
* It's supposed to work with collections of {@link Parser} instances
|
||||
* rather then solve one-instance problems.
|
||||
* All the one-instance stuff is located in Parser class.
|
||||
*
|
||||
* @class
|
||||
* @classdesc Bowser is a static object, that provides an API to the Parsers
|
||||
* @hideconstructor
|
||||
*/
|
||||
class Bowser {
|
||||
/**
|
||||
* Creates a {@link module:parser:Parser} instance
|
||||
* Creates a {@link Parser} instance
|
||||
*
|
||||
* @param {String} UA UserAgent string
|
||||
* @param {Boolean} [skipParsing=false] same as skipParsing for {@link Parser}
|
||||
* @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it
|
||||
* explicitly. Same as `skipParsing` for {@link Parser}.
|
||||
* @returns {Parser}
|
||||
* @throws {Error} when UA is not a String
|
||||
* @throws {BowserUAIsNotAStringError} when UA is not a String
|
||||
*
|
||||
* @example
|
||||
* const parser = Bowser.getParser(window.navigator.userAgent);
|
||||
@ -71,7 +94,7 @@ class Bowser {
|
||||
*/
|
||||
static getParser(UA, skipParsing = false) {
|
||||
if (typeof UA !== 'string') {
|
||||
throw new Error('UserAgent should be a string');
|
||||
throw new BowserUAIsNotAStringError('UserAgent should be a string');
|
||||
}
|
||||
return new Parser(UA, skipParsing);
|
||||
}
|
||||
@ -88,6 +111,22 @@ class Bowser {
|
||||
static parse(UA) {
|
||||
return (new Parser(UA)).getResult();
|
||||
}
|
||||
|
||||
static get BROWSER_MAP() {
|
||||
return BROWSER_MAP;
|
||||
}
|
||||
|
||||
static get ENGINE_MAP() {
|
||||
return ENGINE_MAP;
|
||||
}
|
||||
|
||||
static get OS_MAP() {
|
||||
return OS_MAP;
|
||||
}
|
||||
|
||||
static get PLATFORMS_MAP() {
|
||||
return PLATFORMS_MAP;
|
||||
}
|
||||
}
|
||||
|
||||
export default Bowser;
|
||||
@ -105,12 +144,14 @@ export default Bowser;
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
221
docs/global.html
221
docs/global.html
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -106,6 +107,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -174,21 +177,21 @@
|
||||
|
||||
<div class="description">
|
||||
<p>Get Android version name
|
||||
1.5 - Cupcake
|
||||
1.6 - Donut
|
||||
2.0 - Eclair
|
||||
2.1 - Eclair
|
||||
2.2 - Froyo
|
||||
2.x - Gingerbread
|
||||
3.x - Honeycomb
|
||||
4.0 - Ice Cream Sandwich
|
||||
4.1 - Jelly Bean
|
||||
4.4 - KitKat
|
||||
5.x - Lollipop
|
||||
6.x - Marshmallow
|
||||
7.x - Nougat
|
||||
8.x - Oreo
|
||||
9.x - ?</p>
|
||||
1.5 - Cupcake
|
||||
1.6 - Donut
|
||||
2.0 - Eclair
|
||||
2.1 - Eclair
|
||||
2.2 - Froyo
|
||||
2.x - Gingerbread
|
||||
3.x - Honeycomb
|
||||
4.0 - Ice Cream Sandwich
|
||||
4.1 - Jelly Bean
|
||||
4.4 - KitKat
|
||||
5.x - Lollipop
|
||||
6.x - Marshmallow
|
||||
7.x - Nougat
|
||||
8.x - Oreo
|
||||
9.x - ?</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -267,6 +270,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -291,6 +296,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -427,6 +433,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -447,6 +455,166 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="name" id="getBrowserTypeByAlias"><span class="type-signature"></span>getBrowserTypeByAlias<span class="signature">(browserName)</span><span class="type-signature"> → {string}</span></h4>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="details">
|
||||
|
||||
|
||||
<dt class="tag-source">Source:</dt>
|
||||
<dd class="tag-source"><ul class="dummy"><li>
|
||||
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line215">line 215</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="description">
|
||||
<p>Get short version/alias for a browser name</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Example</h5>
|
||||
|
||||
<pre class="prettyprint"><code>getBrowserAlias('edge') // Microsoft Edge</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Parameters:</h5>
|
||||
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>Name</th>
|
||||
|
||||
|
||||
<th>Type</th>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="name"><code>browserName</code></td>
|
||||
|
||||
|
||||
<td class="type">
|
||||
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="description last"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="param-type">
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<span class="param-type">string</span>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -601,6 +769,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -633,6 +803,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -782,6 +953,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -814,6 +987,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -950,6 +1124,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -970,6 +1146,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1124,6 +1301,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -1144,6 +1323,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1321,6 +1501,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h5>Returns:</h5>
|
||||
|
||||
|
||||
@ -1341,6 +1523,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1995,12 +2178,14 @@ like <code>"iPhone"</code> or <code>"Kindle Fire HD 7"</code
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -39,6 +40,11 @@
|
||||
|
||||
|
||||
|
||||
<section class="package">
|
||||
<h3> </h3>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -49,33 +55,50 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<section class="readme">
|
||||
<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>
|
||||
<p><a href="https://travis-ci.org/lancedikson/bowser/"><img src="https://travis-ci.org/lancedikson/bowser.svg?branch=master" alt="Build Status"></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/lancedikson/bowser.svg" alt="Greenkeeper badge"></a><a href="https://coveralls.io/github/lancedikson/bowser?branch=master"><img src="https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master" alt="Coverage Status"></a></p>
|
||||
<h1>Contents</h1><ul>
|
||||
<article><h2>Bowser</h2>
|
||||
<p>A small, fast and reach-API browser/platform/engine detector for both browser and node.</p>
|
||||
<ul>
|
||||
<li><strong>Small.</strong> Use plain ES5-version which is ~4.8kB gzipped.</li>
|
||||
<li><strong>Optimized.</strong> Use only those parsers you need — it doesn't do useless work.</li>
|
||||
<li><strong>Multi-platform.</strong> It's browser- and node-ready, so you can use it in any environment.</li>
|
||||
</ul>
|
||||
<p>Don't hesitate to support the project on Github or <a href="https://opencollective.com/bowser">OpenCollective</a> if you like it ❤️ Also, contributors are always welcome!</p>
|
||||
<p><a href="https://travis-ci.org/lancedikson/bowser/"><img src="https://travis-ci.org/lancedikson/bowser.svg?branch=master" alt="Build Status"></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/lancedikson/bowser.svg" alt="Greenkeeper badge"></a> <a href="https://coveralls.io/github/lancedikson/bowser?branch=master"><img src="https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master" alt="Coverage Status"></a></p>
|
||||
<h1>Contents</h1>
|
||||
<ul>
|
||||
<li><a href="#overview">Overview</a></li>
|
||||
<li><a href="#use-cases">Use cases</a></li>
|
||||
<li><a href="#advanced-usage">Advanced usage</a></li>
|
||||
<li><a href="#contributing">How can I help?</a></li>
|
||||
</ul>
|
||||
<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>
|
||||
<h3>⚠️ Version 2.0 breaking changes ⚠️</h3><p>Version 2.0 has drastically changed the API. All available methods are on the <a href="https://lancedikson.github.io/bowser/docs">docs page</a>.</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>
|
||||
<h3>⚠️ Version 2.0 breaking changes ⚠️</h3>
|
||||
<p>Version 2.0 has drastically changed the API. All available methods are on the <a href="https://lancedikson.github.io/bowser/docs">docs page</a>.</p>
|
||||
<p><em>For legacy code, check out the <a href="https://github.com/lancedikson/bowser/tree/v1.x">1.x</a> branch and install it through <code>npm install bowser@1.9.4</code>.</em></p>
|
||||
<h1>Use cases</h1><p>First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.</p>
|
||||
<h1>Use cases</h1>
|
||||
<p>First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.</p>
|
||||
<pre class="prettyprint source lang-javascript"><code>const Bowser = require("bowser"); // CommonJS
|
||||
|
||||
import * as Bowser from "bowser"; // TypeScript
|
||||
|
||||
import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInterop enabled)</code></pre><p>By default, the exported version is the <em>ES5 transpiled version</em>, which <strong>do not</strong> include any polyfills.</p>
|
||||
import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInterop enabled)
|
||||
</code></pre>
|
||||
<p>By default, the exported version is the <em>ES5 transpiled version</em>, which <strong>do not</strong> include any polyfills.</p>
|
||||
<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 do 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>
|
||||
<pre class="prettyprint source lang-javascript"><code>const browser = Bowser.getParser(window.navigator.userAgent);
|
||||
|
||||
console.log(`The current browser name is "${browser.getBrowserName()}"`);
|
||||
// The current browser name is "Internet Explorer"</code></pre><p>or</p>
|
||||
// The current browser name is "Internet Explorer"
|
||||
</code></pre>
|
||||
<p>or</p>
|
||||
<pre class="prettyprint source lang-javascript"><code>const browser = Bowser.getParser(window.navigator.userAgent);
|
||||
console.log(browser.getBrowser());
|
||||
|
||||
@ -83,7 +106,9 @@ console.log(browser.getBrowser());
|
||||
{
|
||||
name: "Internet Explorer"
|
||||
version: "11.0"
|
||||
}</code></pre><p>or</p>
|
||||
}
|
||||
</code></pre>
|
||||
<p>or</p>
|
||||
<pre class="prettyprint source lang-javascript"><code>console.log(Bowser.parse(window.navigator.userAgent));
|
||||
|
||||
// outputs
|
||||
@ -104,7 +129,10 @@ console.log(browser.getBrowser());
|
||||
name: "Trident"
|
||||
version: "7.0"
|
||||
}
|
||||
}</code></pre><h2>Filtering browsers</h2><p>You could want to filter some particular browsers to provide any special support for them or make any workarounds.
|
||||
}
|
||||
</code></pre>
|
||||
<h2>Filtering browsers</h2>
|
||||
<p>You could want to filter some particular browsers to provide any special support for them or make any workarounds.
|
||||
It could look like this:</p>
|
||||
<pre class="prettyprint source lang-javascript"><code>const browser = Bowser.getParser(window.navigator.userAgent);
|
||||
const isValidBrowser = browser.satisfies({
|
||||
@ -133,16 +161,21 @@ const isValidBrowser = browser.satisfies({
|
||||
// and loose-equality operator
|
||||
chrome: "~20" // will match any 20.* sub-version
|
||||
chrome: "~20.1" // will match any 20.1.* sub-version (20.1.19 as well as 20.1.12.42-alpha.1)
|
||||
});</code></pre><p>Settings for any particular OS or platform has more priority and redefines settings of standalone browsers.
|
||||
});
|
||||
</code></pre>
|
||||
<p>Settings for any particular OS or platform has more priority and redefines settings of standalone browsers.
|
||||
Thus, you can define OS or platform specific rules and they will have more priority in the end.</p>
|
||||
<p>More of API and possibilities you will find in the <code>docs</code> folder.</p>
|
||||
<h3>Browser names for <code>.satisfies()</code></h3><p>By default you are supposed to use the full browser name for <code>.satisfies</code>.
|
||||
<h3>Browser names for <code>.satisfies()</code></h3>
|
||||
<p>By default you are supposed to use the full browser name for <code>.satisfies</code>.
|
||||
But, there's a short way to define a browser using short aliases. The full
|
||||
list of aliases can be found in <a href="src/constants.js">the file</a>.</p>
|
||||
<h2>Similar Projects</h2><ul>
|
||||
<h2>Similar Projects</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/BigBadBleuCheese/Kong">Kong</a> - A C# port of Bowser.</li>
|
||||
</ul>
|
||||
<h2>License</h2><p>Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.</p></article>
|
||||
<h2>License</h2>
|
||||
<p>Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.</p></article>
|
||||
</section>
|
||||
|
||||
|
||||
@ -157,12 +190,14 @@ list of aliases can be found in <a href="src/constants.js">the file</a>.</p>
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -452,15 +453,14 @@ class Parser {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isBrowser(browserName, includingAlias = false) {
|
||||
const defaultBrowserName = this.getBrowserName();
|
||||
const possibleNames = [defaultBrowserName.toLowerCase()];
|
||||
const alias = Utils.getBrowserAlias(defaultBrowserName);
|
||||
const defaultBrowserName = this.getBrowserName().toLowerCase();
|
||||
let browserNameLower = browserName.toLowerCase();
|
||||
const alias = Utils.getBrowserTypeByAlias(browserNameLower);
|
||||
|
||||
if (includingAlias && typeof alias !== 'undefined') {
|
||||
possibleNames.push(alias.toLowerCase());
|
||||
if (includingAlias && alias) {
|
||||
browserNameLower = alias.toLowerCase();
|
||||
}
|
||||
|
||||
return possibleNames.indexOf(browserName.toLowerCase()) !== -1;
|
||||
return browserNameLower === defaultBrowserName;
|
||||
}
|
||||
|
||||
compareVersion(version) {
|
||||
@ -546,12 +546,14 @@ export default Parser;
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,11 +1,20 @@
|
||||
function hideAllButCurrent(){
|
||||
//by default all submenut items are hidden
|
||||
$("nav > ul > li > ul li").hide();
|
||||
//but we need to rehide them for search
|
||||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
|
||||
parent.style.display = "none";
|
||||
});
|
||||
|
||||
//only current page (if it exists) should be opened
|
||||
var file = window.location.pathname.split("/").pop();
|
||||
$("nav > ul > li > a[href^='"+file+"']").parent().find("> ul li").show();
|
||||
var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
|
||||
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
|
||||
var href = parent.attributes.href.value.replace(/\.html/, '');
|
||||
if (file === href) {
|
||||
parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
|
||||
elem.style.display = "block";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
$( document ).ready(function() {
|
||||
hideAllButCurrent();
|
||||
});
|
||||
|
||||
hideAllButCurrent();
|
12
docs/scripts/nav.js
Normal file
12
docs/scripts/nav.js
Normal file
@ -0,0 +1,12 @@
|
||||
function scrollToNavItem() {
|
||||
var path = window.location.href.split('/').pop().replace(/\.html/, '');
|
||||
document.querySelectorAll('nav a').forEach(function(link) {
|
||||
var href = link.attributes.href.value.replace(/\.html/, '');
|
||||
if (path === href) {
|
||||
link.scrollIntoView({block: 'center'});
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
scrollToNavItem();
|
4
docs/scripts/polyfill.js
Normal file
4
docs/scripts/polyfill.js
Normal file
@ -0,0 +1,4 @@
|
||||
//IE Fix, src: https://www.reddit.com/r/programminghorror/comments/6abmcr/nodelist_lacks_foreach_in_internet_explorer/
|
||||
if (typeof(NodeList.prototype.forEach)!==typeof(alert)){
|
||||
NodeList.prototype.forEach=Array.prototype.forEach;
|
||||
}
|
@ -1,42 +1,83 @@
|
||||
$( document ).ready(function() {
|
||||
jQuery.expr[':'].Contains = function(a,i,m){
|
||||
return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
|
||||
};
|
||||
//on search
|
||||
$("#nav-search").on("keyup", function(event) {
|
||||
var search = $(this).val();
|
||||
if (!search) {
|
||||
//no search, show all results
|
||||
$("nav > ul > li").show();
|
||||
|
||||
if(typeof hideAllButCurrent === "function"){
|
||||
//let's do what ever collapse wants to do
|
||||
hideAllButCurrent();
|
||||
}
|
||||
else{
|
||||
//menu by default should be opened
|
||||
$("nav > ul > li > ul li").show();
|
||||
}
|
||||
}
|
||||
else{
|
||||
//we are searching
|
||||
//show all parents
|
||||
$("nav > ul > li").show();
|
||||
//hide all results
|
||||
$("nav > ul > li > ul li").hide();
|
||||
//show results matching filter
|
||||
$("nav > ul > li > ul").find("a:Contains("+search+")").parent().show();
|
||||
//hide parents without children
|
||||
$("nav > ul > li").each(function(){
|
||||
if($(this).find("a:Contains("+search+")").length == 0 && $(this).children("ul").length === 0){
|
||||
//has no child at all and does not contain text
|
||||
$(this).hide();
|
||||
}
|
||||
else if($(this).find("a:Contains("+search+")").length == 0 && $(this).find("ul").children(':visible').length == 0){
|
||||
//has no visible child and does not contain text
|
||||
$(this).hide();
|
||||
}
|
||||
|
||||
var searchAttr = 'data-search-mode';
|
||||
function contains(a,m){
|
||||
return (a.textContent || a.innerText || "").toUpperCase().indexOf(m) !== -1;
|
||||
};
|
||||
|
||||
//on search
|
||||
document.getElementById("nav-search").addEventListener("keyup", function(event) {
|
||||
var search = this.value.toUpperCase();
|
||||
|
||||
if (!search) {
|
||||
//no search, show all results
|
||||
document.documentElement.removeAttribute(searchAttr);
|
||||
|
||||
document.querySelectorAll("nav > ul > li:not(.level-hide)").forEach(function(elem) {
|
||||
elem.style.display = "block";
|
||||
});
|
||||
|
||||
if (typeof hideAllButCurrent === "function"){
|
||||
//let's do what ever collapse wants to do
|
||||
hideAllButCurrent();
|
||||
} else {
|
||||
//menu by default should be opened
|
||||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
|
||||
elem.style.display = "block";
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//we are searching
|
||||
document.documentElement.setAttribute(searchAttr, '');
|
||||
|
||||
//show all parents
|
||||
document.querySelectorAll("nav > ul > li").forEach(function(elem) {
|
||||
elem.style.display = "block";
|
||||
});
|
||||
//hide all results
|
||||
document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
|
||||
elem.style.display = "none";
|
||||
});
|
||||
//show results matching filter
|
||||
document.querySelectorAll("nav > ul > li > ul a").forEach(function(elem) {
|
||||
if (!contains(elem.parentNode, search)) {
|
||||
return;
|
||||
}
|
||||
elem.parentNode.style.display = "block";
|
||||
});
|
||||
//hide parents without children
|
||||
document.querySelectorAll("nav > ul > li").forEach(function(parent) {
|
||||
var countSearchA = 0;
|
||||
parent.querySelectorAll("a").forEach(function(elem) {
|
||||
if (contains(elem, search)) {
|
||||
countSearchA++;
|
||||
}
|
||||
});
|
||||
|
||||
var countUl = 0;
|
||||
var countUlVisible = 0;
|
||||
parent.querySelectorAll("ul").forEach(function(ulP) {
|
||||
// count all elements that match the search
|
||||
if (contains(ulP, search)) {
|
||||
countUl++;
|
||||
}
|
||||
|
||||
// count all visible elements
|
||||
var children = ulP.children
|
||||
for (i=0; i<children.length; i++) {
|
||||
var elem = children[i];
|
||||
if (elem.style.display != "none") {
|
||||
countUlVisible++;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (countSearchA == 0 && countUl === 0){
|
||||
//has no child at all and does not contain text
|
||||
parent.style.display = "none";
|
||||
} else if(countSearchA == 0 && countUlVisible == 0){
|
||||
//has no visible child and does not contain text
|
||||
parent.style.display = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
@ -16,7 +16,6 @@ body {
|
||||
padding: 0 20px;
|
||||
font-family: 'Helvetica Neue', Helvetica, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
img {
|
||||
@ -41,8 +40,13 @@ article a:hover, article a:active {
|
||||
border-bottom-color: #222;
|
||||
}
|
||||
|
||||
article .description a {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
p, ul, ol, blockquote {
|
||||
margin-bottom: 1em;
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
@ -65,6 +69,7 @@ h1.page-title {
|
||||
font-size: 48px;
|
||||
margin: 1em 30px;
|
||||
line-height: 100%;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@ -179,6 +184,10 @@ nav #nav-search{
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
nav.wrap a{
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
nav h3 {
|
||||
margin-top: 12px;
|
||||
font-size: 13px;
|
||||
@ -234,13 +243,12 @@ nav ul ul a:active {
|
||||
}
|
||||
|
||||
nav h2 {
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
nav > h2 > a {
|
||||
display: block;
|
||||
margin: 10px 0 -10px;
|
||||
color: #606 !important;
|
||||
}
|
||||
@ -596,6 +604,15 @@ span.param-type, .params td .param-type, .param-type dd {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* nav level */
|
||||
.level-hide {
|
||||
display: none;
|
||||
}
|
||||
html[data-search-mode] .level-hide {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (min-width: 320px) and (max-width: 680px) {
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
|
@ -13,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<script src="scripts/nav.js" defer></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
@ -24,9 +25,9 @@
|
||||
|
||||
<label for="nav-trigger" class="overlay"></label>
|
||||
|
||||
<nav>
|
||||
<nav >
|
||||
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="BowserUAIsNotAStringError.html">BowserUAIsNotAStringError</a></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<div id="main">
|
||||
@ -41,7 +42,7 @@
|
||||
|
||||
<section>
|
||||
<article>
|
||||
<pre class="prettyprint source linenums"><code>import { BROWSER_ALIASES_MAP } from './constants.js';
|
||||
<pre class="prettyprint source linenums"><code>import { BROWSER_MAP, BROWSER_ALIASES_MAP } from './constants.js';
|
||||
|
||||
export default class Utils {
|
||||
/**
|
||||
@ -245,6 +246,19 @@ export default class Utils {
|
||||
static getBrowserAlias(browserName) {
|
||||
return BROWSER_ALIASES_MAP[browserName];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get short version/alias for a browser name
|
||||
*
|
||||
* @example
|
||||
* getBrowserAlias('edge') // Microsoft Edge
|
||||
*
|
||||
* @param {string} browserName
|
||||
* @return {string}
|
||||
*/
|
||||
static getBrowserTypeByAlias(browserAlia) {
|
||||
return BROWSER_MAP[browserAlia] || '';
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</article>
|
||||
@ -260,12 +274,14 @@ export default class Utils {
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 03 2019 21:50:23 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 16 2019 22:20:27 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/polyfill.js"></script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bowser",
|
||||
"version": "2.4.0",
|
||||
"version": "2.5.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bowser",
|
||||
"version": "2.4.0",
|
||||
"version": "2.5.0",
|
||||
"description": "Lightweight browser detector",
|
||||
"keywords": [
|
||||
"browser",
|
||||
|
Loading…
Reference in New Issue
Block a user