diff --git a/docs/index.html b/docs/index.html index e309bf0..bd94440 100644 --- a/docs/index.html +++ b/docs/index.html @@ -80,12 +80,12 @@ -

Overview

+

Overview

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. Check it out on this page: https://bowser-js.github.io/bowser-online/.

⚠️ Version 2.0 breaking changes ⚠️

Version 2.0 has drastically changed the API. All available methods are on the docs page.

For legacy code, check out the 1.x branch and install it through npm install bowser@1.9.4.

-

Use cases

+

Use cases

First of all, require the library. This is a UMD Module, so it will work for AMD, TypeScript, ES6, and CommonJS module systems.

const Bowser = require("bowser"); // CommonJS
 
@@ -98,14 +98,14 @@ import Bowser from "bowser"; // ES6 (and TypeScript with --esModuleInt
 So, for you it's suitable to require bowser like this: require('bowser/bundled').
 As the result, you get a ES5 version of bowser with babel-polyfill bundled together.

You may need to use the source files, so they will be available in the package as well.

-

Browser props detection

+

Browser props detection

Often we need to pick users' browser properties such as the name, the version, the rendering engine and so on. Here is an example how to do it with Bowser:

const browser = Bowser.getParser(window.navigator.userAgent);
 
 console.log(`The current browser name is "${browser.getBrowserName()}"`);
 // The current browser name is "Internet Explorer"
 
-

Using User-Agent Client Hints

+

Using User-Agent Client Hints

Modern browsers support User-Agent Client Hints, which provide a more privacy-friendly and structured way to access browser information. Bowser can use Client Hints data to improve browser detection accuracy.

// Pass Client Hints as the second parameter
 const browser = Bowser.getParser(
@@ -190,7 +190,7 @@ console.log(browser.getBrowser());
 
 // Same output structure, but with enhanced detection from Client Hints
 
-

Filtering browsers

+

Filtering browsers

You could want to filter some particular browsers to provide any special support for them or make any workarounds. It could look like this:

const browser = Bowser.getParser(window.navigator.userAgent);