mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Merge pull request #282 from JBallin/readme-capitalize-bowser
Capitalize imported Bowser object
This commit is contained in:
commit
2949f37127
@ -43,7 +43,7 @@ You may need to use the source files, so they will be available in the package a
|
|||||||
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:
|
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:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const browser = bowser.getParser(window.navigator.userAgent);
|
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||||
|
|
||||||
console.log(`The current browser name is "${browser.getBrowserName()}"`);
|
console.log(`The current browser name is "${browser.getBrowserName()}"`);
|
||||||
// The current browser name is "Internet Explorer"
|
// The current browser name is "Internet Explorer"
|
||||||
@ -54,7 +54,7 @@ or
|
|||||||
```javascript
|
```javascript
|
||||||
const impression = new Impression();
|
const impression = new Impression();
|
||||||
|
|
||||||
const browser = bowser.getParser(window.navigator.userAgent);
|
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||||
const browserInfo = browser.getBrowser();
|
const browserInfo = browser.getBrowser();
|
||||||
impression.brName = browserInfo.name;
|
impression.brName = browserInfo.name;
|
||||||
impression.brVer = browserInfo.version;
|
impression.brVer = browserInfo.version;
|
||||||
@ -63,7 +63,7 @@ impression.brVer = browserInfo.version;
|
|||||||
or
|
or
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const browser = bowser.getParser(window.navigator.userAgent);
|
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||||
impression.userTechData = browser.parse();
|
impression.userTechData = browser.parse();
|
||||||
console.log(impression.userTechData);
|
console.log(impression.userTechData);
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ You could want to filter some particular browsers to provide any special support
|
|||||||
It could look like this:
|
It could look like this:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const browser = bowser.getParser(window.navigator.userAgent);
|
const browser = Bowser.getParser(window.navigator.userAgent);
|
||||||
const isValidBrowser = browser.satisfies({
|
const isValidBrowser = browser.satisfies({
|
||||||
// declare browsers per OS
|
// declare browsers per OS
|
||||||
windows: {
|
windows: {
|
||||||
|
Loading…
Reference in New Issue
Block a user