https://github.com/ianwalter/is-chrome
Detect whether a browser or user-agent is Chrome
https://github.com/ianwalter/is-chrome
browser browser-detection google-chrome user-agent
Last synced: 5 months ago
JSON representation
Detect whether a browser or user-agent is Chrome
- Host: GitHub
- URL: https://github.com/ianwalter/is-chrome
- Owner: ianwalter
- License: other
- Created: 2020-06-11T15:25:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T22:03:16.000Z (over 3 years ago)
- Last Synced: 2025-02-10T15:50:36.959Z (over 1 year ago)
- Topics: browser, browser-detection, google-chrome, user-agent
- Language: JavaScript
- Homepage:
- Size: 210 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @ianwalter/is-chrome
> Detect whether a browser or user-agent is Chrome
[![npm page][npmImage]][npmUrl]
[![CI][ciImage]][ciUrl]
## Installation
```console
yarn add @ianwalter/is-chrome
```
## Usage
Browser:
```js
import isChrome from '@ianwalter/is-chrome'
// Firefox 65:
isChrome() // => false
// Chrome 72:
isChrome() // => true
```
Node.js:
```js
const isChrome = require('@ianwalter/is-chrome')
// Firefox 65:
isChrome(req.get('user-agent')) // => false
// Chrome 72:
isChrome(req.get('user-agent')) // => true
```
## License
Hippocratic License - See [LICENSE][licenseUrl]
Created by [Ian Walter](https://ianwalter.dev)
[npmImage]: https://img.shields.io/npm/v/@ianwalter/is-chrome.svg
[npmUrl]: https://www.npmjs.com/package/@ianwalter/is-chrome
[ciImage]: https://github.com/ianwalter/is-chrome/workflows/CI/badge.svg
[ciUrl]: https://github.com/ianwalter/is-chrome/actions
[soUrl]: https://stackoverflow.com/a/10199306/894420
[licenseUrl]: https://github.com/ianwalter/is-chrome/blob/master/LICENSE