Logo

Termux-Playwright

v1.61.3 (Dual Engine)
PyPI (Python) npm (Node.js) 💖 Sponsor GitHub Repository

API Reference Manual

Comprehensive documentation of all public functions, classes, and parameter options in termux_playwright (Python) and termux-playwright (Node.js).

📦 Package Identifiers

Python (PyPI): import termux_playwright

Node.js (npm): const termuxPlaywright = require('termux-playwright')

🐍 Python Public API Specification

async_playwright_termux()

Asynchronous context manager replacing upstream async_playwright().

sync_playwright_termux()

Synchronous context manager replacing upstream sync_playwright().

launch(p, low_memory_mode=False, jitless=None, ignore_certificate_errors=False, standalone_mode=False, wake_lock=False, stealth=False, single_process=False, **kwargs)

Launches hardened Chromium on Android Termux.

setup_stealth_context(browser, ...)

Creates an evasive BrowserContext bypassing Cloudflare Turnstile & DataDome.

block_heavy_resources(page_or_context, images=True, media=True, fonts=True, stylesheets=False)

Aborts heavy network asset requests to conserve mobile bandwidth and CPU.


☕ Node.js / TypeScript API Specification

launch(playwrightInstance?, options?: TermuxLaunchOptions): Promise<Browser>

Launches Chromium in Node.js with automated session token tracking, eMMC RAM cache, and WakeLock.

setupStealthContext(browser: Browser, options?: BrowserContextOptions): Promise<BrowserContext>

Injects prototype-safe stealth script removing navigator.webdriver and mocking native C++ bindings.

blockHeavyResources(pageOrContext, options?): Promise<void>

Aborts image, media, and font downloads in Node.js.

forceGarbageCollection(): boolean

Triggers V8 garbage collection when --expose-gc is enabled.