Skip to content

Commit 54fe87f

Browse files
V5 (#42)
- Improve fingerprint stability on desktop multi-monitor setups and mobile - Improve fingerprint stability mobile devices - Reduce false-positive changes between sessions on the same device, especially desktops. - Remove low-entropy / deprecated signals: cookieEnabled, doNotTrack, plugins/mimeTypes
1 parent ffe70d9 commit 54fe87f

File tree

11 files changed

+543
-1441
lines changed

11 files changed

+543
-1441
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules/
22
.idea/
3+
.vscode/
4+
.DS_Store
5+
lcov.info

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.6
1+
v25.6

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
# get-browser-fingerprint
22

3-
Zero dependencies package exporting a single and fast (<50ms) asynchronous function returning a browser fingerprint, without requiring any permission to the user.
3+
A single and fast (<50ms) asynchronous function returning a browser fingerprint, without requiring any permission to the user.
4+
5+
## Assumptions
6+
7+
The function is targeting stock installations of the following browsers (no extensions or add-ons installed):
8+
- Google Chrome (desktop and Android)
9+
- Mozilla Firefox (desktop, default tracking protection, no custom privacy flags enabled)
10+
- Microsoft Edge (desktop and Android)
11+
- Apple Safari (macOS)
12+
- Safari on iOS / iPadOS
13+
14+
Explicit assumptions:
15+
- No privacy-focused extensions or add-ons installed.
16+
- Browser privacy settings left at factory defaults (no manual changes to fingerprint resistance features).
17+
- No hardened, anti-detect or heavily modified browser variants.
18+
19+
Under these conditions the collected signals retain meaningful entropy in February 2026:
20+
- Canvas rendering (stable on Chrome, Edge, Firefox default; noisy or low-entropy on iOS Safari and partially on macOS Safari)
21+
- WebGL unmasked vendor and renderer (strong on desktop, more uniform on mobile)
22+
- Offline audio context (useful on Chrome, Edge, Firefox; heavily restricted on Safari)
23+
- WebGPU properties (if available; low but increasing entropy)
24+
- Locally installed fonts (valuable mainly on desktop Windows and macOS)
25+
- Passive signals (hardwareConcurrency, deviceMemory, screen, timezone, languages, etc.)
26+
27+
On browsers with strong default fingerprint resistance (Safari iOS, certain Firefox modes) entropy and stability decrease significantly.
28+
The script does not attempt to bypass intentional randomization or hardening.
429

530
## Usage
631

7-
Get browser fingerprint:
32+
Get browser fingerprint:
833
```js
934
import getBrowserFingerprint from 'get-browser-fingerprint';
1035
const fingerprint = await getBrowserFingerprint();
@@ -19,9 +44,13 @@ Options available:
1944

2045
To test locally:
2146
```sh
22-
fnm install
23-
pnpm install
47+
fnm install # nodejs from .nvmrc
48+
npm install -g corepack
49+
corepack enable # package manager from package.json
50+
corepack install # package manager from package.json
51+
pnpm install # install deps
2452
pnpm exec playwright install chromium
53+
pnpm exec playwright install firefox
2554
pnpm test
2655
```
2756

biome.json

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.0/schema.json",
3+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
34
"vcs": {
45
"enabled": true,
56
"clientKind": "git",
67
"useIgnoreFile": true
78
},
89
"formatter": {
910
"indentStyle": "space",
10-
"indentWidth": 2,
11-
"lineWidth": 160,
12-
"lineEnding": "lf"
11+
"lineWidth": 180
12+
},
13+
"javascript": {
14+
"formatter": {
15+
"quoteStyle": "single"
16+
}
1317
},
1418
"linter": {
15-
"enabled": true,
16-
"rules": {
17-
"recommended": true,
18-
"a11y": {
19-
"recommended": false
20-
},
21-
"suspicious": {
22-
"recommended": false
23-
},
24-
"correctness": {
25-
"noUnusedImports": {
26-
"level": "error"
27-
},
28-
"noUnusedVariables": {
29-
"level": "error"
30-
}
31-
}
19+
"enabled": true
20+
},
21+
"html": {
22+
"formatter": {
23+
"enabled": true
3224
}
3325
}
3426
}

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
"author": "Damiano Barbati <damiano.barbati@gmail.com> (https://github.com/damianobarbati)",
55
"repository": "https://github.com/damianobarbati/get-browser-fingerprint",
66
"license": "MIT",
7-
"main": "src/index.js",
7+
"packageManager": "pnpm@10.28.2",
8+
"engines": {
9+
"node": ">=25.6",
10+
"pnpm": ">=10.28"
11+
},
812
"type": "module",
13+
"main": "src/index.js",
914
"files": [
1015
"README.md",
1116
"package.json",
@@ -14,13 +19,13 @@
1419
],
1520
"types": "./src/index.d.ts",
1621
"scripts": {
22+
"postinstall": "pnpm audit --audit-level critical",
1723
"lint": "biome check --write",
18-
"test": "vitest run"
24+
"test": "node --test --test-reporter=spec --test-reporter-destination=stdout"
1925
},
2026
"devDependencies": {
21-
"@biomejs/biome": "^2.2.2",
22-
"@playwright/test": "^1.55.0",
23-
"serve": "^14.2.4",
24-
"vitest": "^3.2.4"
27+
"@biomejs/biome": "^2.4.0",
28+
"@playwright/test": "^1.58.2",
29+
"serve": "^14.2.5"
2530
}
2631
}

0 commit comments

Comments
 (0)