+
Skip to content

gillstrom/is-chrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-chrome

Check if browser is Google Chrome

User agent sniffing is considered bad practice and should be avoided if possible.

Install

$ npm install is-chrome

Usage

const isChrome = require('is-chrome');

isChrome();
//=> true

isChrome({version: 42});
//=> true

isChrome({userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 OPR/29.0.1795.60'});
//=> false (This is from Opera)

isChrome([options])

Returns a boolean.

options

Type: object

options.userAgent

Type: string

User agent to test.

options.version

Type: string or number

Check for specific version.

Related

  • brwsr - Get current browser

License

MIT © Andreas Gillström

About

Check if browser is Google Chrome

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载