cutetailbud/ff-ruyijs

Developer Tools

Run a site's own JavaScript from Python through Firefox's SpiderMonkey and Necko engines, without a window or renderer.

132
144
C++
NOASSERTION
new today

ruyiJS is a Python binding around Firefox's SpiderMonkey JS engine and Necko networking stack, packaged as a headless execution environment for running site JavaScript, replaying captured flows and inspecting network behavior from Python. It targets scraping, JavaScript reverse engineering and automation work where a plain HTTP client fails because the page's scripts must run.

What it changes in a workflow

Instead of driving a full browser, Python code opens a Context — a separate process holding the JS engine, DOM and network stack — and calls context.eval(). Variables and functions persist across calls, and JS functions can be returned as callables or Python callbacks exposed into the page. A load_page() call resolves relative URLs against a supplied base, and in-page fetch/XHR use Necko over HTTP/1.1, 2 or 3. Timers can be driven by a logical clock so runs are reproducible, and put_resource() lets a captured flow be replayed with no network. See the feature overview for the full API surface.

How the engine matters

The distinguishing claim is that the JavaScript engine and TLS stack are Mozilla's own rather than emulated: SpiderMonkey (Firefox 159) executes the page scripts, and the NSS library produces the TLS ClientHello, so the wire fingerprint matches Firefox rather than a reimplementation. The README also says the transport can switch between Firefox 100–159 TLS profiles, giving different JA3/JA4 fingerprints. These are author claims; the packaged examples include Akamai, DataDome and CreepJS flows, though the README notes live results depend on current network conditions and the site's responses.

Requirements and boundaries

  • Windows x64 only, with Python 3.10+ (tested up to 3.14); macOS and Linux are stated as not yet supported. The wheel bundles the native runtime, so no separate browser download is needed; see installation.
  • No window, page layout or rendering — it is an analysis and automation environment, not a visual browser.
  • The README's limitation section notes the tool should be used in compliance with site terms and applicable law. The licence is source-available, not OSI open source: personal and research use is free, modifications must be open-sourced when distributed, and commercial use requires written authorisation. Check the license before any commercial deployment.

A repository-created 2026-10-28 and still Windows-only in its documentation makes platform support the first thing to verify for a team outside Windows.

Written by AI from the project's README, updated October 29, 2026. The project's own docs are the source of truth.