1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00
This commit is contained in:
Denis Demchenko
2018-07-08 12:31:23 +03:00
parent 3a9c4b3a3d
commit 31b9240aec
9 changed files with 100 additions and 70 deletions

View File

@@ -113,7 +113,7 @@ const isValidBrowser = bowser.compare({
chrome: ">20.1.1432",
firefox: ">31",
opera: ">22"
});</code></pre><p>As you can see, settings for any particular OS has more priority and redefines settings of <code>any</code> property.</p>
});</code></pre><p>Settings for any particular OS has more priority and redefines settings of standalone browsers.</p>
<h3>new Bowser(<code>:Object</code>)</h3><p>Use it to get object with detected flags of your current browser.</p>
<h3>bowser._detect(ua <code>:String</code>)<code>:Object</code></h3><p>Use it to get object with detected flags from User Agent string.</p>
<h3>bowser.check(minVersions<code>:Object</code>, strictMode<code>:Boolean</code>, [ua]<code>:String</code>)<code>:Boolean</code></h3><p>Use it to check if browser is supported. In default non-strict mode any browser family not present in <code>minVersions</code> will pass the check (like Chrome in the third call in the sample bellow). When strict mode is enabled then any not specified browser family in <code>minVersions</code> will cause <code>check</code> to return <code>false</code> (in the sample it is the fourth call, the last one).</p>
@@ -145,13 +145,6 @@ bowser.check({chrome: &quot;45&quot;}, true, window.navigator.userAgent); // fal
</ul>
<p>For unknown browsers, Bowser makes a best guess from the UA string. So, these may not be set.</p>
<h3>Rendering engine flags</h3><p>If detected, one of these flags may be set to true:</p>
<ul>
<li><code>webkit</code> - Chrome 0-27, Android &lt;4.4, iOs, BB, etc.</li>
<li><code>blink</code> - Chrome &gt;=28, Android &gt;=4.4, Opera, etc.</li>
<li><code>gecko</code> - Firefox, etc.</li>
<li><code>msie</code> - IE &lt;= 11</li>
<li><code>msedge</code> - IE &gt; 11</li>
</ul>
<p>Safari, Chrome and some other minor browsers will report that they have <code>webkit</code> engines.
Firefox and Seamonkey will report that they have <code>gecko</code> engines.</p>
<pre class="prettyprint source lang-js"><code>if (bowser.webkit) {
@@ -243,7 +236,7 @@ check if all tests are still passing.</p>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Jul 08 2018 12:09:12 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 Jul 08 2018 12:30:49 GMT+0300 (EEST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>