# playwright-anti-fingerprinter

> puppeteer extra plugin to randomise your browser fingerprint

Latest version **1.2.1** (published 2025-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install playwright-anti-fingerprinter
pnpm add playwright-anti-fingerprinter
yarn add playwright-anti-fingerprinter
bun add playwright-anti-fingerprinter
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2025-03-23 |
| First published | 2023-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 12 |
| Unpacked size | 310.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | JijaProGamer |
| Maintainers | bloxxy213 |
| Keywords | anti-fingerprinting, playwright |

## Links

- npm: https://www.npmjs.com/package/playwright-anti-fingerprinter
- Repository: https://github.com/JijaProGamer/playwright-anti-fingerprinter
- Homepage: https://github.com/JijaProGamer/playwright-anti-fingerprinter#readme
- Issues: https://github.com/JijaProGamer/playwright-anti-fingerprinter/issues
- npm.io page: https://npm.io/package/playwright-anti-fingerprinter

## Dependencies (12)

- [got](https://npm.io/package/got.md) ^13.0.0
- [express](https://npm.io/package/express.md) ^4.19.2
- [lru-cache](https://npm.io/package/lru-cache.md) ^10.0.1
- [agent-base](https://npm.io/package/agent-base.md) ^7.1.0
- [playwright](https://npm.io/package/playwright.md) ^1.51.1
- [tough-cookie](https://npm.io/package/tough-cookie.md) ^4.1.3
- [ua-parser-js](https://npm.io/package/ua-parser-js.md) ^1.0.33
- [http-proxy-agent](https://npm.io/package/http-proxy-agent.md) ^7.0.0
- [playwright-cache](https://npm.io/package/playwright-cache.md) ^1.0.1
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^7.0.2
- [socks-proxy-agent](https://npm.io/package/socks-proxy-agent.md) ^8.0.2
- [country-locale-map](https://npm.io/package/country-locale-map.md) ^1.9.0

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2025-03-23
- 1.2.0 — 2025-03-23
- 1.1.9 — 2025-03-22
- 1.1.8 — 2025-03-22
- 1.1.7 — 2024-08-25
- 1.1.6 — 2024-08-25
- 1.1.5 — 2024-06-01
- 1.1.4 — 2024-06-01
- 1.1.3 — 2024-05-14
- 1.1.2 — 2024-02-26
- 1.1.1 — 2024-02-26
- 1.1.0 — 2024-02-26
- 1.0.8 — 2024-01-24
- 1.0.7 — 2023-11-18
- 1.0.6 — 2023-10-11
- … 6 more at https://npm.io/package/playwright-anti-fingerprinter/versions

## README

NOTE: This does not fix the issues with headless: true!!! If you want to use a headless mode use headless: "new" or other ways

# Constructor

```js
import { GetCommonFingerprint, GenerateFingerprint, ConnectFingerprinter } from "playwright-anti-fingerprinter"
import { firefox } from "playwright" // chromium and webkit supported too

let commonFingerprint = GetCommonFingerprint("firefox")

function requestInterceptor(page, requestData, route) {
    let request = route.request()

    if(request.resourceType() == "image"){
        return "abort"
    }

    if(requestData.url.includes("banana")){
        return "direct"
    }

    return "proxy"
};

let staticFingerprint = GenerateFingerprint({
    webgl_vendor: (e) => e.includes("Intel") || e.includes("AMD") || e.includes("NVIDIA"), 
    webgl_renderer: (e) => true,
    userAgent: (e) => {return e.includes("Windows NT 10.0")},
    language: (e) => {return e.includes("en")},
    viewport: (e) => {return e.width > 1000 && e.height > 800},
    language: (e) => true,
    cpus: (e) => {return e <= 32 && e >= 4},
    memory: (e) => {return e <= 8},
    compatibleMediaMimes: (e) => {return e.audio.includes("aac"), e.video["mp4"] && e.video.mp4.length > 0},
    proxy: "direct", // Support for string only
    proxy: () => "direct", // Defaults to this, meaning no proxy
})

// For custom caches please read https://github.com/JijaProGamer/Playwright-cache

let memoryCache = {};
// Please don't use this cache implementation if launching multiple browsers using this cache
// since it ignores "type", saving "private" in a public cache object

let cache = {
    save: (URL, type, expires, Data) => {
        return new Promise((resolve, reject) => {
            memoryCache[URL] = { expires, Data }
            resolve()
        })
    },
    read: (URL) => {
        return new Promise((resolve, reject) => {
            let CachedResponse = memoryCache[URL]
            
            if (!CachedResponse) {
                return resolve(false)
            }

            if (Date.now() >= CachedResponse.expires) {
                delete memoryCache[URL]
                return resolve(false)
            }

            resolve(CachedResponse.Data)
        })
    }
}

// You can save fingerprint for later use if you want

// Create browser, etc

await ConnectFingerprinter("firefox", page, {
    fingerprint: staticFingerprint, // if not provided, makes a new one
    requestInterceptor, // if no provided, will proxy everything
    cache // If not provided will use a default cache
})
```

commonFingerprint is the most common fingerprint.

Note! The "plugins" evasions is currently disabled, due to creating

---
_Source: https://npm.io/package/playwright-anti-fingerprinter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
