mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Merge branch 'release/2.0.0-beta.2'
This commit is contained in:
commit
4a4e41ccf8
@ -1,6 +1,8 @@
|
||||
parser: babel-eslint
|
||||
extends: airbnb-base
|
||||
rules:
|
||||
no-underscore-dangle: 0
|
||||
no-void: 0
|
||||
plugins:
|
||||
- ava
|
||||
- import
|
||||
|
@ -2,3 +2,6 @@ language: node_js
|
||||
after_success: npm run coverage
|
||||
node_js:
|
||||
- "8.4.0"
|
||||
script:
|
||||
- npm run lint
|
||||
- npm test
|
||||
|
@ -1,5 +1,12 @@
|
||||
# Bowser Changelog
|
||||
|
||||
### 2.0.0-beta.2 (September 9, 2018)
|
||||
- [FIX] Fix failing comparing version through `Parser.satisfies` (#243)
|
||||
- [FIX] Fix travis testing, include eslint into CI testing
|
||||
- [FIX] Add support for Maxthon desktop browser (#246)
|
||||
- [FIX] Add support for Swing browser (#248)
|
||||
- [DOCS] Regenerate docs
|
||||
|
||||
### 2.0.0-beta.1 (August 18, 2018)
|
||||
- [ADD] Add loose version comparison to `Parser.compareVersion()` and `Parser.satisfies()`
|
||||
- [CHORE] Add CONTRIBUTING.md
|
||||
|
@ -1,7 +1,7 @@
|
||||
## Bowser
|
||||
A Browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms.
|
||||
|
||||
[![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser/)
|
||||
[![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser/) [![Greenkeeper badge](https://badges.greenkeeper.io/lancedikson/bowser.svg)](https://greenkeeper.io/)
|
||||
|
||||
# Contents
|
||||
- [Overview](#overview)
|
||||
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Bowser - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -53,7 +57,8 @@ All the one-instance stuff is located in Parser class.</p></div>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
@ -137,7 +142,8 @@ All the one-instance stuff is located in Parser class.</p></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -356,7 +362,7 @@ bowser.getResult()</code></pre>
|
||||
</dt>
|
||||
<dd></dd>
|
||||
<dt>
|
||||
<dl>
|
||||
<dl class="param-type">
|
||||
<dt>
|
||||
Type
|
||||
</dt>
|
||||
@ -554,15 +560,19 @@ bowser.getResult()</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Parser - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -49,7 +53,8 @@
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
@ -243,7 +248,8 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1558,7 +1564,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#line432">line 432</a>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line438">line 438</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -2376,7 +2382,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#line441">line 441</a>
|
||||
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line447">line 447</a>
|
||||
</li></ul></dd>
|
||||
|
||||
|
||||
@ -2674,15 +2680,19 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>bowser.js - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -91,15 +95,19 @@ export default Bowser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Global - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -47,7 +51,8 @@
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<div class="container-overview">
|
||||
|
||||
<div class="container-overview">
|
||||
|
||||
|
||||
|
||||
@ -93,7 +98,8 @@
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -753,15 +759,19 @@ like <code>"iPhone"</code> or <code>"Kindle Fire HD 7"</code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Home - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -47,7 +51,7 @@
|
||||
|
||||
<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></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></p>
|
||||
<h1>Contents</h1><ul>
|
||||
<li><a href="#overview">Overview</a></li>
|
||||
<li><a href="#use-cases">Use cases</a></li>
|
||||
@ -145,15 +149,19 @@ check if all tests are still passing.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>parser.js - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -438,6 +442,12 @@ class Parser {
|
||||
let comparableVersion = version;
|
||||
let isLoose = false;
|
||||
|
||||
const currentBrowserVersion = this.getBrowserVersion();
|
||||
|
||||
if (typeof currentBrowserVersion !== 'string') {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
if (version[0] === '>') {
|
||||
expectedResult = 1;
|
||||
comparableVersion = version.substr(1);
|
||||
@ -451,7 +461,7 @@ class Parser {
|
||||
comparableVersion = version.substr(1);
|
||||
}
|
||||
|
||||
return compareVersions(this.getBrowserVersion(), comparableVersion, isLoose) === expectedResult;
|
||||
return compareVersions(currentBrowserVersion, comparableVersion, isLoose) === expectedResult;
|
||||
}
|
||||
|
||||
isOS(osName) {
|
||||
@ -490,15 +500,19 @@ export default Parser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
11
docs/scripts/collapse.js
Normal file
11
docs/scripts/collapse.js
Normal file
@ -0,0 +1,11 @@
|
||||
function hideAllButCurrent(){
|
||||
//by default all submenut items are hidden
|
||||
$("nav > ul > li > ul li").hide();
|
||||
|
||||
//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();
|
||||
}
|
||||
$( document ).ready(function() {
|
||||
hideAllButCurrent();
|
||||
});
|
4
docs/scripts/jquery-3.1.1.min.js
vendored
Normal file
4
docs/scripts/jquery-3.1.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
42
docs/scripts/search.js
Normal file
42
docs/scripts/search.js
Normal file
@ -0,0 +1,42 @@
|
||||
$( 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();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
@ -19,6 +19,10 @@ body {
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
a,
|
||||
a:active {
|
||||
color: #606;
|
||||
@ -60,6 +64,7 @@ h1 {
|
||||
h1.page-title {
|
||||
font-size: 48px;
|
||||
margin: 1em 30px;
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@ -163,6 +168,17 @@ nav {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
nav #nav-search{
|
||||
width: 210px;
|
||||
height: 30px;
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border-radius: 3px;
|
||||
margin-right: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
nav h3 {
|
||||
margin-top: 12px;
|
||||
font-size: 13px;
|
||||
@ -204,14 +220,7 @@ nav > ul {
|
||||
|
||||
nav > ul > li > a {
|
||||
color: #606;
|
||||
}
|
||||
|
||||
nav ul ul {
|
||||
margin-bottom: 10px
|
||||
}
|
||||
|
||||
nav ul ul + ul {
|
||||
margin-top: -10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
nav ul ul a {
|
||||
@ -290,7 +299,7 @@ footer {
|
||||
}
|
||||
|
||||
.details dt {
|
||||
width: 120px;
|
||||
width: auto;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
@ -391,7 +400,7 @@ footer {
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.params, .props {
|
||||
table {
|
||||
border-spacing: 0;
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
@ -402,6 +411,20 @@ footer {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
td, th {
|
||||
margin: 0px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
padding: 10px;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
thead tr, thead tr {
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.params .type {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@ -416,28 +439,10 @@ footer {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.params td, .params th, .props td, .props th {
|
||||
margin: 0px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
padding: 10px;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.params td {
|
||||
border-top: 1px solid #eee
|
||||
}
|
||||
|
||||
.params thead tr, .props thead tr {
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params .params thead tr, .props .props thead tr {
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params td.description > p:first-child, .props td.description > p:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
@ -643,3 +648,7 @@ span.param-type, .params td .param-type, .param-type dd {
|
||||
margin-left: -14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#disqus_thread{
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>utils.js - Documentation</title>
|
||||
|
||||
|
||||
<script src="scripts/prettify/prettify.js"></script>
|
||||
<script src="scripts/prettify/lang-css.js"></script>
|
||||
<!--[if lt IE 9]>
|
||||
@ -11,6 +13,7 @@
|
||||
<![endif]-->
|
||||
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
||||
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -22,6 +25,7 @@
|
||||
<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="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#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#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><a href="global.html">Global</a></h3>
|
||||
</nav>
|
||||
|
||||
@ -149,15 +153,18 @@
|
||||
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
|
||||
if (chunks[0][precision] > chunks[1][precision]) {
|
||||
return 1;
|
||||
} else if (chunks[0][precision] === chunks[1][precision]) {
|
||||
}
|
||||
|
||||
if (chunks[0][precision] === chunks[1][precision]) {
|
||||
if (precision === lastPrecision) {
|
||||
// all version chunks are same
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
precision -= 1;
|
||||
} else if (chunks[0][precision] < chunks[1][precision]) {
|
||||
return -1;
|
||||
}
|
||||
precision -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,15 +196,19 @@ module.exports = Utils;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
<footer>
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Aug 18 2018 14:14:47 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.5.5</a> on Sun Sep 09 2018 15:08:13 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
||||
</footer>
|
||||
|
||||
<script>prettyPrint();</script>
|
||||
<script src="scripts/linenumber.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
2100
package-lock.json
generated
2100
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bowser",
|
||||
"version": "2.0.0-beta.1",
|
||||
"version": "2.0.0-beta.2",
|
||||
"description": "Lightweight browser detector",
|
||||
"keywords": [
|
||||
"browser",
|
||||
@ -29,6 +29,7 @@
|
||||
"ava": "^0.25.0",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^9.0.0",
|
||||
"babel-loader": "^7.1.5",
|
||||
"babel-plugin-add-module-exports": "^0.3.1",
|
||||
"babel-plugin-istanbul": "^4.1.6",
|
||||
@ -36,15 +37,15 @@
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-register": "^6.26.0",
|
||||
"coveralls": "^3.0.2",
|
||||
"docdash": "^0.4.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb-base": "^12.1.0",
|
||||
"eslint-plugin-ava": "^4.5.1",
|
||||
"docdash": "^1.0.0",
|
||||
"eslint": "^5.4.0",
|
||||
"eslint-config-airbnb-base": "^13.1.0",
|
||||
"eslint-plugin-ava": "^5.1.0",
|
||||
"eslint-plugin-import": "^2.13.0",
|
||||
"jsdoc": "^3.5.5",
|
||||
"nyc": "^12.0.2",
|
||||
"sinon": "^2.4.1",
|
||||
"testem": "^1.18.5",
|
||||
"sinon": "^6.1.5",
|
||||
"testem": "^2.9.3",
|
||||
"webpack": "^4.15.1",
|
||||
"webpack-cli": "^3.0.8",
|
||||
"yamljs": "^0.3.0"
|
||||
@ -64,9 +65,9 @@
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.config.js",
|
||||
"prepublish": "npm run build",
|
||||
"lint": "eslint ./src --fix",
|
||||
"lint": "eslint ./src",
|
||||
"testem": "testem",
|
||||
"test": "eslint ./src & nyc --reporter=html --reporter=text ava",
|
||||
"test": "nyc --reporter=html --reporter=text ava",
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"docs": "jsdoc -c jsdoc.json"
|
||||
},
|
||||
|
@ -124,6 +124,21 @@ const browsersList = [
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
{
|
||||
test: [/swing/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'Swing',
|
||||
};
|
||||
const version = getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, ua) || getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
{
|
||||
test: [/coast/i],
|
||||
describe(ua) {
|
||||
@ -170,12 +185,12 @@ const browsersList = [
|
||||
},
|
||||
},
|
||||
{
|
||||
test: [/mxios/i],
|
||||
test: [/Maxthon|mxios/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'Maxthon',
|
||||
};
|
||||
const version = getFirstMatch(commonVersionIdentifier, ua) || getFirstMatch(/(?:mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
||||
const version = getFirstMatch(commonVersionIdentifier, ua) || getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
|
@ -399,6 +399,12 @@ class Parser {
|
||||
let comparableVersion = version;
|
||||
let isLoose = false;
|
||||
|
||||
const currentBrowserVersion = this.getBrowserVersion();
|
||||
|
||||
if (typeof currentBrowserVersion !== 'string') {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
if (version[0] === '>') {
|
||||
expectedResult = 1;
|
||||
comparableVersion = version.substr(1);
|
||||
@ -412,7 +418,7 @@ class Parser {
|
||||
comparableVersion = version.substr(1);
|
||||
}
|
||||
|
||||
return compareVersions(this.getBrowserVersion(), comparableVersion, isLoose) === expectedResult;
|
||||
return compareVersions(currentBrowserVersion, comparableVersion, isLoose) === expectedResult;
|
||||
}
|
||||
|
||||
isOS(osName) {
|
||||
|
@ -110,15 +110,18 @@ class Utils {
|
||||
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
|
||||
if (chunks[0][precision] > chunks[1][precision]) {
|
||||
return 1;
|
||||
} else if (chunks[0][precision] === chunks[1][precision]) {
|
||||
}
|
||||
|
||||
if (chunks[0][precision] === chunks[1][precision]) {
|
||||
if (precision === lastPrecision) {
|
||||
// all version chunks are same
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
precision -= 1;
|
||||
} else if (chunks[0][precision] < chunks[1][precision]) {
|
||||
return -1;
|
||||
}
|
||||
precision -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -984,6 +984,20 @@
|
||||
engine:
|
||||
name: "WebKit"
|
||||
version: "601.1.46"
|
||||
- ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 [FBAN/FBIOS;FBDV/iPhone7,2;FBMD/iPhone;FBSN/iOS;FBSV/11.4.1;FBSS/2;FBCR/vfnl;FBID/phone;FBLC/nl_NL;FBOP/5;FBRV/0]"
|
||||
spec:
|
||||
browser:
|
||||
name: "Safari"
|
||||
os:
|
||||
name: "iOS"
|
||||
version: "11.4.1"
|
||||
platform:
|
||||
type: "mobile"
|
||||
vendor: "Apple"
|
||||
model: "iPhone"
|
||||
engine:
|
||||
name: "WebKit"
|
||||
version: "605.1.15"
|
||||
Internet Explorer:
|
||||
-
|
||||
ua: "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MAARJS; rv:11.0) like Gecko"
|
||||
@ -2261,6 +2275,21 @@
|
||||
engine:
|
||||
name: "WebKit"
|
||||
version: "601.1.46"
|
||||
-
|
||||
ua: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Maxthon/4.1.0.4000 Chrome/26.0.1410.43 Safari/537.1"
|
||||
spec:
|
||||
browser:
|
||||
name: "Maxthon"
|
||||
version: "4.1.0.4000"
|
||||
os:
|
||||
name: "Windows"
|
||||
version: "NT 6.1"
|
||||
versionName: "7"
|
||||
platform:
|
||||
type: "desktop"
|
||||
engine:
|
||||
name: "WebKit"
|
||||
version: "537.1"
|
||||
Epiphany:
|
||||
-
|
||||
ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Debian/buildd-unstable (3.18.5-1) Epiphany/3.18.5"
|
||||
@ -2415,3 +2444,18 @@
|
||||
type: "tablet"
|
||||
engine:
|
||||
name: "Blink"
|
||||
Swing:
|
||||
-
|
||||
ua: "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.105 Safari/537.36 Swing/4.2.4.0"
|
||||
spec:
|
||||
browser:
|
||||
name: "Swing"
|
||||
version: "4.2.4.0"
|
||||
os:
|
||||
name: "Windows"
|
||||
version: "NT 10.0"
|
||||
versionName: "10"
|
||||
platform:
|
||||
type: "desktop"
|
||||
engine:
|
||||
name: "Blink"
|
||||
|
@ -57,7 +57,7 @@ test('Skip parsing shouldn\'t parse', (t) => {
|
||||
t.deepEqual((new Parser(UA, true)).getResult(), {});
|
||||
});
|
||||
|
||||
test('Parser.check should make simple comparisons', (t) => {
|
||||
test('Parser.satisfies should make simple comparisons', (t) => {
|
||||
// also covers Parser.compareVersion() method
|
||||
t.is(parser.satisfies({ opera: '>42' }), true);
|
||||
t.is(parser.satisfies({ opera: '<44' }), true);
|
||||
@ -66,7 +66,7 @@ test('Parser.check should make simple comparisons', (t) => {
|
||||
t.is(parser.satisfies({ opera: '~43' }), true);
|
||||
});
|
||||
|
||||
test('Parser.check should make complex comparison', (t) => {
|
||||
test('Parser.satisfies should make complex comparison', (t) => {
|
||||
t.is(parser.satisfies({
|
||||
macos: {
|
||||
safari: '>11',
|
||||
@ -78,7 +78,7 @@ test('Parser.check should make complex comparison', (t) => {
|
||||
}), true);
|
||||
});
|
||||
|
||||
test('Parser.check should respect platform and OS specific declarations', (t) => {
|
||||
test('Parser.satisfies should respect platform and OS specific declarations', (t) => {
|
||||
t.is(parser.satisfies({
|
||||
macos: {
|
||||
opera: '>45',
|
||||
@ -114,6 +114,14 @@ test('Parser.check should respect platform and OS specific declarations', (t) =>
|
||||
}), void 0);
|
||||
});
|
||||
|
||||
test('Parser.satisfies for versionless UA strings', (t) => {
|
||||
const _parser = new Parser('Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 [FBAN/FBIOS;FBDV/iPhone7,2;FBMD/iPhone;FBSN/iOS;FBSV/11.4.1;FBSS/2;FBCR/vfnl;FBID/phone;FBLC/nl_NL;FBOP/5;FBRV/0]');
|
||||
|
||||
t.is(_parser.satisfies({
|
||||
safari: '>9',
|
||||
}), void 0);
|
||||
});
|
||||
|
||||
test('Parser.is should pass', (t) => {
|
||||
t.is(parser.is('opera'), true);
|
||||
t.is(parser.is('desktop'), true);
|
||||
|
Loading…
Reference in New Issue
Block a user