Skip to content

seleniumbase-rs 0.3.0

Choose a tag to compare

@MustCodeAl MustCodeAl released this 15 Oct 22:38
· 496 commits to main since this release

A breaking release: the experimental stealth scraping layer leaves this crate.

Removed

  • BREAKING: the stealth scraping layer moved to its own repository,
    seleniumbase-rs-stealth.

    The features scrape and impersonate, the modules seleniumbase_rs::wire,
    seleniumbase_rs::scrape and seleniumbase_rs::impersonate, and their
    crate-root re-exports (BrowserScraper, CookieJar, StealthIdentity,
    SessionPolicy, ScrapeError, BrowserKind, Emulation, TlsSpec,
    H2Spec, HeaderSpec, ImpersonationProfile, CustomProfileBuilder,
    impersonation_client, HttpSession, MitmProxy, StealthSession,
    EphemeralCa and the rest) are gone from this crate. They are now the crates
    seleniumbase-rs-wire (was the module wire), seleniumbase-rs-scrape (was
    the feature scrape) and seleniumbase-rs-impersonate (was the feature
    impersonate), which build on the public API of this crate and stay
    experimental. Depend on them by git, for example
    seleniumbase-rs-scrape = { git = "https://github.com/MustCodeAl/seleniumbase-rs-stealth" },
    and give seleniumbase-rs by its plain git URL next to them so both resolve to
    one commit (Stealth Scraping).
  • With the layer go the optional dependencies psl, wreq, btls,
    tokio-btls, brotli, hyper, hyper-util and http-body-util; the
    examples capture_tls, capture_hints, capture_h2, cookie_jar,
    browser_scraper, custom_profile, http_session and stealth_session; the
    tests and fixtures of the layer; the just scrape-gate, imp-gate and
    measure recipes and their mise tasks; the scrape CI matrix entries and the
    impersonate CI job; and CMake, NASM and LLVM from the build requirements.
  • futures-util without its default macros (select!/join!, unused), so the
    futures-macro proc macro is no longer compiled.
  • scraper without its default features (getopts for its own CLI, unused
    parse-error text). flate2 asks only for the zlib-rs backend zip already
    builds (pdf-extract still turns on its default one).
  • The unused tracing-futures dependency (every build compiled it) and the
    unused tracing-actix one from the full-tracing feature.
  • JSON logs come from tracing-subscriber's own JSON format instead of the
    separate json-subscriber crate.
  • The playwright feature no longer lists rustwright-core itself; rustwright
    already brings it without Python.
  • HTTPS uses rustls with the ring crypto provider for every client, so the
    aws-lc-sys C library is no longer compiled. A program that builds its own
    reqwest client next to this crate calls seleniumbase_rs::install_tls_provider()
    first.
  • reqwest no longer builds its blocking client: ending reused sessions at
    exit uses the async client on a small runtime of its own.
  • thirtyfour is built without its component derive macros and its own
    driver manager (this crate downloads drivers itself), which also removes its
    older zip and dirs.
  • zip is built with deflate only (the format of driver downloads and the
    bundled extensions) instead of every format; zstd (a C library), bzip2, lzma,
    xz, ppmd and AES no longer compile.

Fixed

  • A WebDriver URL with a path and no trailing slash (a Grid's
    http://hub:4444/wd/hub, or tauri-plugin-sbrs-automation's
    http://127.0.0.1:4445/<token>) lost its last path segment, because the
    client joins command paths as relative URLs; the slash is added when
    connecting.

Changed

  • The generated browser identity claims Chrome 154, 155 or 156 (was 153 to
    155), and its high-entropy Client Hints name a real build per major
    (stealth::randomize::KNOWN_FULL_VERSIONS: 155.0.8059.40 measured on macOS
    27.0.1 by tests/client_hints_chrome.rs, 154.0.8037.100 and 156.0.8078.35 from
    Google's version history) instead of major.0.0.0. Macs claim macOS 15.8.1,
    26.7.1, 27.0.0 or 27.0.1; iPhones may claim Safari 26.0 with the frozen
    iPhone OS 18_6 (Safari 17.7 is gone). The Chrome presets, the --mobile
    user agent and the examples claim Chrome 156 (PRESET_CHROMIUM_MAJOR), the
    Android ones in Chrome's frozen Linux; Android 10; K form, and the iPhone
    preset is Safari 26.0. Seeds map to other identities than before.

  • A fingerprint without Client Hints (the presets) gets its brand list, decoy
    brand and full versions from chromium_hints(major) instead of a fixed
    Not(A:Brand 24, the Client Hints platform name (Windows, not Win32), and
    a fullVersionList.

  • The sbrs banner reads SeleniumBaseRust (figlet small font, 68 columns), and
    sbrs --help and sbrs-mcp --help say SeleniumBaseRust.

  • The tests' leftover-process checks (Edge, geckodriver, the MCP stdio servers)
    list processes with sysinfo (a dev-dependency) instead of pgrep and
    kill -0, so they run on Windows too instead of being skipped there.

  • Human-paced input draws its bell-curve values (stealth::humanize::Rng::gaussian,
    used by stealth::behavior) from rand_distr's StandardNormal instead of a
    hand-written Box-Muller transform. The distribution is the same, but a seeded
    Humanizer now plans different paths and timings than before for the same
    seed. humanize::Rng implements rand::TryRng (so rand::Rng), and
    rand_distr is a new dependency.

Added

  • sbrs devtools launches Chrome with its DevTools endpoint open (--port,
    default 9222), prints the endpoint and configs for Google's
    chrome-devtools-mcp and Microsoft's Playwright MCP (--json for one line of
    JSON), and runs until Ctrl-C, which closes the browser. The Pure CDP MCP server
    has get_devtools_endpoint, and Browser::devtools_endpoint() and
    LaunchOptionsBuilder::debugging_port do the same from Rust. See
    docs/tutorials/devtools_mcp.md, which also covers Firefox's and Safari's MCP
    servers.

  • .github/workflows/release.yml builds sbrs and sbrs-mcp for five targets
    on a version tag and attaches the archives, with completions and Warp
    workflows, to the release; [package.metadata.binstall] points cargo binstall at them. Not run yet (GitHub Actions is locked on the account).

  • Feature ocr (off by default): ocr::Ocr reads the text a page shows from
    its screenshot (read_page, for a BaseCase or an sb_cdp::Page) or from PNG
    bytes (text_in_png), with ocrs, pure
    Rust. Its two models (about 12 MB) are downloaded into the cache folder on
    first use and checked against pinned SHA-256 hashes; SB_OCR_MODELS names a
    folder of your own copies instead.

  • Browser plugins for the Pure CDP engine (feature plugins, off by default;
    ADR 004 phase 2). LaunchOptionsBuilder::plugins takes a PluginSet from the
    plugin API crate
    seleniumbase-rs-plugin,
    re-exported as seleniumbase_rs::plugin_api. Browser::launch checks the set,
    lets before_launch change the arguments, preferences, extensions, proxy and
    headless mode, and calls on_browser; every tab the library attaches to gets
    the plugins' packages and on_page_created; Browser::close (or the last
    drop) calls on_close. Browser::connect_with_plugins does the same for a
    running browser. A plugin that refuses or fails stops the launch or the tab
    with the new SeleniumBaseError::Plugin. Guide: docs/tutorials/plugins.md.

  • LaunchOptionsBuilder::extension loads an unpacked extension over the
    protocol (Extensions.loadUnpacked, which branded Chrome 137 and later need
    instead of --load-extension), and LaunchOptionsBuilder::preference merges
    a preference into the profile's Default/Preferences before the browser
    starts.

  • Browser::launch_mocked (feature test-util) runs the launch steps, plugins
    included, against a MockCtrl, which MockCtrl::new now creates for a test
    to script first.

  • Feature tokio-console (off by default): sbrs, sbrs-mcp and programs that
    use the crate's logging serve tokio-console
    for watching async tasks. Build with RUSTFLAGS="--cfg tokio_unstable".