You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-12Lines changed: 21 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,14 @@ If you want to fingerprint browsers, you are **_probably_** also interested in o
12
12
13
13
Below are some features that make ClientJS different from other fingerprinting libraries:
14
14
- It's pure native JavaScript
15
-
- It's decently lightweight at ~45 KB
15
+
- It's decently lightweight at ~50 KB (full bundle) or ~28 KB (minimal bundle)
16
16
- All user data points are available by design, not just the 32bit integer fingerprint
17
17
18
18
## Documentation and Demos
19
19
You can find more documentation and demos on each method at [clientjs.org](https://clientjs.org/).
20
20
21
21
## Installation
22
-
To use ClientJS, simply include `dist/client.min.js`.
22
+
To use ClientJS, simply include `dist/client.min.js` or one of the other bundles (see [bundles](#bundles) section for more details)
23
23
24
24
ClientJS is available for download via [bower](http://bower.io/search/?q=clientjs) and [npm](https://www.npmjs.com/package/clientjs).
25
25
@@ -50,7 +50,11 @@ Below is an example of how to generate and display a fingerprint:
50
50
51
51
```javascript
52
52
// Create a new ClientJS object
53
+
54
+
// in a browser:
53
55
var client =newClientJS();
56
+
// or in a CommonJS environment:
57
+
var client =require('clientjs').ClientJS;
54
58
55
59
// Get the client's fingerprint id
56
60
var fingerprint =client.getFingerprint();
@@ -77,6 +81,14 @@ The current data-points that used to generate fingerprint 32bit integer hash ID
77
81
- cookies
78
82
- canvas print
79
83
84
+
## Bundles
85
+
For maximum flexibility, this library is distributed in 4 different pre-bundled variants for the browser:
86
+
87
+
-`dist/client.min.js` - full distribution bundle, contains Flash and Java detection mechanisms
88
+
-`dist/client.flash.min.js` - contains Flash detection mechanism but misses Java detection (`getJavaVersion()` will throw an error when called)
89
+
-`dist/client.java.min.js` - contains Java detection mechanism but misses Flash detection (`getFlashVersion()` will throw an error when called)
90
+
-`dist/client.base.min.js` - misses both, Flash and Java detection mechanisms (`getFlashVersion()` and `getJavaVersion()` will throw an error when called)
91
+
80
92
## Available Methods
81
93
Below is the current list of available methods to find information on a users browser/device.
82
94
@@ -139,9 +151,9 @@ You can find documentation on each method at [clientjs.org](https://clientjs.org
139
151
140
152
client.getPlugins();
141
153
client.isJava();
142
-
client.getJavaVersion();
154
+
client.getJavaVersion(); // functional only in java and full builds, throws an error otherwise
143
155
client.isFlash();
144
-
client.getFlashVersion();
156
+
client.getFlashVersion(); // functional only in flash and full builds, throws an error otherwise
145
157
client.isSilverlight();
146
158
client.getSilverlightVersion();
147
159
@@ -174,31 +186,28 @@ Built Upon:
174
186
- detectmobilebrowsers.com
175
187
176
188
## Vendor Code
177
-
All dependencies are included into `client.min.js`when the `build.sh` bash file minifies the project. Vendored dependencies should not be included separately.
189
+
All dependencies are included into the minified bundles when the `npm run build` script minifies the project. Vendored dependencies should not be included separately.
178
190
179
191
Dependencies Include:
180
-
- ua-parser.js
181
192
- fontdetect.js
182
-
- swfobject.js
193
+
- swfobject.js - included only in full and Flash builds (only `client.min.js` and `client.flash.min.js`)
183
194
- murmurhash3.js
195
+
- deployJava.js - included only in full and Java builds (only `client.min.js` and `client.java.min.js`)
184
196
185
197
## Contributing
186
198
Collaborate by [forking](https://help.github.com/articles/fork-a-repo/) this project and sending a Pull Request this way.
187
199
188
-
Once cloned, install all dependencies. ClientJS uses [Karma](https://karma-runner.github.io/0.13/index.html) as its testing environment.
200
+
Once cloned, install all dependencies. ClientJS uses [Karma](https://karma-runner.github.io/5.2/index.html) as its testing environment.
189
201
190
202
```shell
191
203
# Install dependencies
192
204
$ npm install
193
-
194
-
# If you want tu run karma from the command line
195
-
$ npm install -g karma-cli
196
205
```
197
206
198
207
Run Karma and enjoy coding!
199
208
200
209
```shell
201
-
$ karma start
210
+
$ npm test
202
211
```
203
212
204
213
Thanks for contributing to ClientJS! Please report any bug [here](https://github.com/jackspirou/clientjs/issues).
0 commit comments