# atubodad/playwright_stealth architecture

> Architecture diagram of the GitHub repository atubodad/playwright_stealth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atubodad/playwright_stealth
- Repository: https://github.com/atubodad/playwright_stealth

## Overview

playwright_stealth is a small Playwright library that installs browser-fingerprinting patches before page navigation. The main workflow is a user applying the sync or async API, configuration selecting initialization scripts, and Playwright registering them on the page. The scripts cover navigator properties, Chrome APIs, iframe behavior, media codecs and WebGL. Several individual script files are indexed but not excerpted; their specific behavior and internal links are therefore not expanded beyond documented capabilities and shown registrations.

Main entry points: [`playwright_stealth/stealth.py`](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/stealth.py) (Stealth API and config), [`playwright_stealth/js/utils.js`](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/utils.js) (JavaScript utilities), [`playwright_stealth/js/navigator.plugins.js`](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.plugins.js) (Plugins and MIME), [`playwright_stealth/js/chrome.app.js`](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.app.js) (Chrome app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python API"]
  node_stealth["Stealth API and config<br/>[stealth.py]"]
end

subgraph group_navigator["Navigator patches"]
  node_webdriver["Webdriver flag"]
  node_useragent["User agent"]
  node_plugins["Plugins and MIME"]
  node_navprops["Other navigator properties"]
end

subgraph group_chrome["Chrome patches"]
  node_chromeapp["Chrome app<br/>[chrome.app.js]"]
  node_chromeruntime["Chrome runtime<br/>[chrome.runtime.js]"]
  node_chrometimes["Chrome load timing"]
  node_chromemisc["Other Chrome properties"]
end

subgraph group_web["Web APIs and helpers"]
  node_iframe["Iframe window"]
  node_media["Media codecs<br/>[media.codecs.js]"]
  node_webgl["WebGL vendor<br/>[webgl.vendor.js]"]
  node_dimensions["Window dimensions"]
  node_magicarrays["Magic arrays helper"]
  node_utils["JavaScript utilities<br/>[utils.js]"]
end

node_user(("Library user"))
node_page["Playwright page"]

node_user -->|"applies"| node_stealth
node_stealth -->|"registers scripts"| node_page
node_stealth -->|"selects script"| node_webdriver
node_stealth -->|"selects script"| node_useragent
node_stealth -->|"selects script"| node_plugins
node_stealth -->|"selects scripts"| node_navprops
node_stealth -->|"selects script"| node_chromeapp
node_stealth -->|"selects script"| node_chromeruntime
node_stealth -->|"selects script"| node_chrometimes
node_stealth -->|"selects scripts"| node_chromemisc
node_stealth -->|"selects script"| node_iframe
node_stealth -->|"selects script"| node_media
node_stealth -->|"selects script"| node_webgl
node_stealth -->|"selects script"| node_dimensions
node_stealth -->|"loads helper"| node_magicarrays
node_stealth -->|"loads helper"| node_utils
node_plugins -->|"generates arrays"| node_magicarrays
node_plugins -->|"uses utilities"| node_utils
node_chromeruntime -->|"mocks functions"| node_utils
node_iframe -->|"replaces proxy"| node_utils
node_media -->|"replaces proxy"| node_utils
node_chromeapp -->|"patches strings"| node_utils

click node_stealth "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/stealth.py"
click node_webdriver "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.webdriver.js"
click node_useragent "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.userAgent.js"
click node_plugins "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.plugins.js"
click node_navprops "https://github.com/atubodad/playwright_stealth/tree/main/playwright_stealth/js"
click node_chromeapp "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.app.js"
click node_chromeruntime "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.runtime.js"
click node_chrometimes "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.load.times.js"
click node_chromemisc "https://github.com/atubodad/playwright_stealth/tree/main/playwright_stealth/js"
click node_iframe "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/iframe.contentWindow.js"
click node_media "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/media.codecs.js"
click node_webgl "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/webgl.vendor.js"
click node_dimensions "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/window.outerdimensions.js"
click node_magicarrays "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/generate.magic.arrays.js"
click node_utils "https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/utils.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_stealth,node_user toneBlue
class node_webdriver,node_useragent,node_plugins,node_navprops toneAmber
class node_chromeapp,node_chromeruntime,node_chrometimes,node_chromemisc toneMint
class node_iframe,node_media,node_webgl,node_dimensions,node_magicarrays,node_utils toneRose
class node_page toneIndigo
```

## Components

### Python API

- [Stealth API and config](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/stealth.py): `playwright_stealth/stealth.py`

### Navigator patches

- [Webdriver flag](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.webdriver.js): `playwright_stealth/js/navigator.webdriver.js`
- [User agent](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.userAgent.js): `playwright_stealth/js/navigator.userAgent.js`
- [Plugins and MIME](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/navigator.plugins.js): `playwright_stealth/js/navigator.plugins.js`
- [Other navigator properties](https://github.com/atubodad/playwright_stealth/tree/main/playwright_stealth/js): `playwright_stealth/js`

### Chrome patches

- [Chrome app](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.app.js): `playwright_stealth/js/chrome.app.js`
- [Chrome runtime](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.runtime.js): `playwright_stealth/js/chrome.runtime.js`
- [Chrome load timing](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/chrome.load.times.js): `playwright_stealth/js/chrome.load.times.js`
- [Other Chrome properties](https://github.com/atubodad/playwright_stealth/tree/main/playwright_stealth/js): `playwright_stealth/js`

### Web APIs and helpers

- [Iframe window](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/iframe.contentWindow.js): `playwright_stealth/js/iframe.contentWindow.js`
- [Media codecs](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/media.codecs.js): `playwright_stealth/js/media.codecs.js`
- [WebGL vendor](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/webgl.vendor.js): `playwright_stealth/js/webgl.vendor.js`
- [Window dimensions](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/window.outerdimensions.js): `playwright_stealth/js/window.outerdimensions.js`
- [Magic arrays helper](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/generate.magic.arrays.js): `playwright_stealth/js/generate.magic.arrays.js`
- [JavaScript utilities](https://github.com/atubodad/playwright_stealth/blob/main/playwright_stealth/js/utils.js): `playwright_stealth/js/utils.js`

### Other components

- **Library user**
- **Playwright page**

## Connections

- Library user → Stealth API and config: applies (evidence: `README.md`)
- Stealth API and config → Playwright page: registers scripts (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Webdriver flag: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → User agent: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Plugins and MIME: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Other navigator properties: selects scripts (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Chrome app: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Chrome runtime: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Chrome load timing: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Other Chrome properties: selects scripts (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Iframe window: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Media codecs: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → WebGL vendor: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Window dimensions: selects script (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → Magic arrays helper: loads helper (evidence: `playwright_stealth/stealth.py`)
- Stealth API and config → JavaScript utilities: loads helper (evidence: `playwright_stealth/stealth.py`)
- Plugins and MIME → Magic arrays helper: generates arrays (evidence: `playwright_stealth/js/navigator.plugins.js`)
- Plugins and MIME → JavaScript utilities: uses utilities (evidence: `playwright_stealth/js/navigator.plugins.js`)
- Chrome runtime → JavaScript utilities: mocks functions (evidence: `playwright_stealth/js/chrome.runtime.js`)
- Iframe window → JavaScript utilities: replaces proxy (evidence: `playwright_stealth/js/iframe.contentWindow.js`)
- Media codecs → JavaScript utilities: replaces proxy (evidence: `playwright_stealth/js/media.codecs.js`)
- Chrome app → JavaScript utilities: patches strings (evidence: `playwright_stealth/js/chrome.app.js`)
