Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas101 committed Mar 9, 2021
0 parents commit a6094cd
Show file tree
Hide file tree
Showing 8 changed files with 3,554 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# chromium-detector
Use feature detection to work out the running version of Chromium. No more UserAgent hackery!

## Demo
Head over to [https://chromiumchecker.com](https://chromiumchecker.com).

## Install

```bash
npm install chromium-detector
```

## Features

- Uses a known feature list to work out the running version of Chromium
- Doesn't need to use the UserAgent or anything else that could be spoofed
- Provides info on each feature detected for more comprehensive results

## Usage

```javascript
var chromiumDetector = require('chromium-detector')
console.log(chromiumDetector.getBrowserInfo())
/*
{
isChromium: true,
version: '89',
couldBeOlder: false,
couldBeNewer: false,
tests: {
"89": {
pass: 0,
result: true,
tests: [...],
releaseDate: "2021-03-02",
isPreRelease: false
}
}
}
*/
```

## API

### getBrowserInfo()
Returns: object with the following...

* **isChromium**: `Boolean` true/false whether this looks to be Chromium
* **version**: `String` the chromium milestone version (e.g. 89) or 'unknown'
* **couldBeOlder**: `Boolean` true/false if the detected version of Chromium could be older than what the library can detect (i.e. all tests failed)
* **couldBeNewer**: `Boolean` true/false if the detected version of Chromium could be newer than what the library can detect (i.e. all tests passed)
* **tests**: `Object` an object of test results for each version
1 change: 1 addition & 0 deletions dist/chromium-detector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6094cd

Please sign in to comment.