Skip to main content

Gecko Web Runtime Client

Python page and browser client for a versioned Firefox-derived WPR runtime. It exposes pages, contexts, navigation, DOM access, screenshots, diagnostics, Turnstile and WeChat workflow adapters.

The native runtime is installed separately:

python -m gecko_web_runtime install-runtime --version 155

The runtime is held in a private GitHub Release. Automatic download needs access to childclm/gecko-web-runtime. The Python client depends on wpr-runtime-core for Worker lifecycle and protocol compatibility. Historical HTTP imports are retained through wpr-http.

Optional HTTP WeChat integration

The same distribution includes gecko_web_runtime.integrations.wechat. It uses wpr-http and a local Node.js environment, with no browser Page. Install version 1.4.3 or newer with its optional dependencies, then prepare Node.js 20+ dependencies in the user's cache:

pip install --upgrade "gecko-web-runtime-client[wechat]>=1.4.3"
python -m gecko_web_runtime.integrations.wechat install-js

These commands require a client build containing this integration. An older published package does not acquire the integration by installing the extra. Local development: pip install -e "./python[wechat]".

from gecko_web_runtime.integrations.wechat import AsyncWechatClient

async with AsyncWechatClient(proxy="") as client:
    result = await client.get(article_url)
    print(result.summary())
    if result.ok:
        article_html = result.html

Only Node dependencies are installed by install-js; a compatible Firefox network runtime is installed separately through wpr-http. Native graphics queries additionally require an installed Firefox ANGLE directory containing libEGL.dll and libGLESv2.dll, passed as native_gl_dir or NATIVE_GL_DIR. Direct article responses need neither Node nor native graphics.

One client retains one HTTP session and serializes its article flows. Separate client instances have separate HTTP and JavaScript state. total_timeout bounds an active flow; cancellation terminates an active Node subprocess. The module uses Python logging and does not configure application handlers. Artifacts are off by default; output_dir opts into per-call directories that can contain session-sensitive diagnostic data. Keep those directories outside source control. Site rejection is returned as a structured failure, not a promise that any verification will succeed.

Media capture

For a browser-played Widevine page, use AsyncMediaDownloader. It starts the Worker, provisions the caller's Widevine profile, enables bounded native H.264 capture, waits for playback progress, writes a checkpoint, and verifies the final MP4 with FFmpeg.

import asyncio
from pathlib import Path

from gecko_web_runtime import AsyncMediaDownloader


async def main() -> None:
    result = await AsyncMediaDownloader(
        "https://example.test/video",
        output_dir=Path("./media-output"),
        ffmpeg=Path(r"C:\\ffmpeg\\bin\\ffmpeg.exe"),
        expected_duration=2575.32,
        max_retries=1,
    ).download()
    if not result["completed"]:
        raise RuntimeError(result["attempts"])
    print(result["package"]["output"])


asyncio.run(main())

Set WPR_RUNTIME_DIR, WPR_WORKER_EXE, WPR_PERSISTENT_PROFILE_DIR, and WPR_ENABLE_CDM=1 before creating the downloader. Widevine is installed by Firefox's official GMP installer into the persistent WPR profile; no existing Firefox profile or component is imported. This requires the Worker build with runtime.widevine_start/status support (Runtime 155.0.8 or later). For a bounded smoke test of a longer page, use sample_seconds=120 instead of expected_duration. The downloader keeps a checkpoint.json; rerunning with the same output directory returns a completed result without starting another Worker.

Metadata

Release files for gecko-web-runtime-client 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gecko-web-runtime-client 1.4.3
File Size Uploaded Provenance
gecko_web_runtime_client-1.4.3.tar.gz 163.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gecko-web-runtime-client 1.4.3
File Interpreter ABI Platform
gecko_web_runtime_client-1.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 342.2 kB

Release files / gecko_web_runtime_client-1.4.3.tar.gz

Download URL gecko_web_runtime_client-1.4.3.tar.gz
Size 163.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0a123582fa0568a8c14e5b0bd43b88c0156b8b2f3db78a7bc580eded946dac73
BLAKE2b-256 checksum
How to use checksums
dcf46f2a9aa5e02814fefeae221b2b5e96fbfc14fac6c74ffa0c2d2a8e3fe47d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / gecko_web_runtime_client-1.4.3-py3-none-any.whl

Download URL gecko_web_runtime_client-1.4.3-py3-none-any.whl
Size 178.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
391dc003b4bde912f96d11da9a646822a0041ed23f275d073b5f8df0d8d615ab
BLAKE2b-256 checksum
How to use checksums
d4422675c4cd1c6a70772a0fbc7d47b18aef4e9b6d9045eb3a6fcebc41f0bf9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for gecko-web-runtime-client 1.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gecko_web_runtime_client-1.4.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page