Skip to content

Commit

Permalink
Merge ccdac3a into 7fc8f3c
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherry committed Jul 9, 2018
2 parents 7fc8f3c + ccdac3a commit 7f43f44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ The upcoming 2.0 version has drastically changed API. All available methods can

First of all, require the library:

```
```javascript
const bowser = require('bowser');
```

## Browser props detection

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

```
```javascript
const browser = bowser.getParser(window.navigator.userAgent);

console.log(`The current browser name is "${browser.getBrowserName()}"`);
Expand All @@ -39,7 +39,7 @@ console.log(`The current browser name is "${browser.getBrowserName()}"`);

or

```
```javascript
const impression = new Impression();

const browser = bowser.getParser(window.navigator.userAgent);
Expand All @@ -50,7 +50,7 @@ impression.brVer = browserInfo.version;

or

```
```javascript
const browser = bowser.getParser(window.navigator.userAgent);
impression.userTechData = browser.parse();
console.log(impression.userTechData);
Expand Down Expand Up @@ -81,7 +81,7 @@ console.log(impression.userTechData);
You could want to filter some particular browsers to provide any special support for them or make any workarounds.
It could look like this:

```
```javascript
const browser = bowser.getParsers(window.navigator.userAgent);
const isValidBrowser = browser.satisfies({
// declare browsers per OS
Expand Down

0 comments on commit 7f43f44

Please sign in to comment.