Plugins for seleniumbase-rs: Rust crates that change how a browser starts and what every tab gets, the way puppeteer-extra plugins do for Puppeteer. The design is ADR 004. The repository is seleniumbase-rs-plugins:
Plugin framework and community plugins for seleniumbase-rs
Early. Plugins run in seleniumbase-rs 0.3.0 and later, behind its plugins
feature, in the pure CDP engine (sb_cdp), and from 0.4.0 in the WebDriver
engine (BaseCase) too. The Browser Plugins guide
is the user guide: it shows how to attach a set to a browser.
Plugins you can install#
Every plugin is its own crate. The official ones also ship with seleniumbase-rs
behind a cargo feature each (plugin-shield, plugin-block-resources,
plugin-crx, or plugins-builtin for all) and are switched on by name; see
Choosing plugins. The prebuilt sbrs and sbrs-mcp have all of
them compiled in: sbrs --plugin shield open https://example.com, and
sbrs plugin list shows them. Add the crate of one yourself to use it in code;
the plugins are also examples of how to write one.
| Plugin | What it does |
|---|---|
shield | Privacy hardening: turns off the browser’s background reporting, keeps WebRTC from leaking addresses, blocks third-party cookies, refuses a persistent profile |
block-resources | Stops pages from loading images, fonts or media (faster, less data) |
crx | Loads packed Chrome extensions (.crx, CRX3 and CRX2) |
wasm | Runs plugins written in any language that compiles to WebAssembly, sandboxed with wasmi (no host imports, fuel and memory limits) |
To add a plugin’s crate, use cargo add with the revision shown. shield is
also the feature plugin-shield.
The framework itself:
| Crate | What it is |
|---|---|
seleniumbase-rs-plugin | The API: Plugin, PluginSet, LaunchSettings, Package, the BrowserHandle and PageHandle traits |
seleniumbase-rs-plugin-testing | Recording fakes of the handles, to test a plugin without a browser |
template | Start your own plugin from here (see Writing your own); install it by copying the folder |
More plugins live in their own repositories, such as
tauri-plugin-sbrs-automation. Search GitHub for the
topic seleniumbase-rs-plugin to find community ones.
The cargo features, the command-line options, the [plugins] table, SB_PLUGINS and the builder calls.
Privacy hardening for the browser seleniumbase-rs starts.
The user guide: turn plugins on, attach a set to a browser, when each hook runs.
A plugin in a few lines, the template, and how to test it without a browser.
Stop pages from loading images, fonts or media.
Load packed Chrome extensions.
Plugins written in any language that compiles to WebAssembly.
How the hooks run#
Every hook is optional: before_launch (change the browser’s start-up
settings), on_browser, on_page_created, on_close. A plugin can also
declare JavaScript and CSS packages for every tab, its dependencies on other
plugins, and requirements (run last, a visible window, a Chromium browser, a
browser it starts itself). Errors in the launch and page hooks stop the launch or
the tab instead of being skipped.
The hooks, in the order they run
The details of each hook, and what the pure CDP engine does at each point, are in When the hooks run.
A plugin is code that runs with your program’s rights and sees every page, cookie and password the browser handles. Review a plugin before you add it, as you would any dependency.
License#
MIT.