Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 19 days 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T22:03:16.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T23:35:39.185Z (2 months 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