A plugin says what it is and what it needs by returning a Metadata from
Plugin::metadata (and, for a configurable plugin, from
Configurable::describe). The set orders, checks, grants and audits plugins
from it. Items are in seleniumbase_rs_plugin, defined in
crates/seleniumbase-rs-plugin/src/metadata.rs. The design is on
Plugin architecture.
Metadata#
struct non_exhaustive seleniumbase_rs_plugin::Metadata
What a plugin declares about itself. Build one with Metadata::new and the
builder methods; outside the crate the fields can be read and assigned, not
listed in a struct literal.
The plugin’s category; None for a legacy plugin, which declares nothing.
The plugin’s version, such as env!("CARGO_PKG_VERSION"). Shown by
sbrs plugin info.
Default: "empty"
One line about what it does. Shown by sbrs plugin list and sbrs plugin info.
Default: "empty"
What it needs. The check fails when the host cannot give one or the set did not grant it. See Capabilities.
Default: "empty"
What it uses when granted. Granted by default like capabilities, minus the
Critical ones, and listed by the audit, but never checked.
Default: "empty"
Metadata::new#
fnWhat kind of job the plugin does.
A declared plugin of category, with an empty version and summary, no
capabilities, no edges, no phase of its own, no seals and no budgets.
Metadata::legacy#
fnAn undeclared plugin: category: None and capabilities: CapabilitySet::legacy() (launch.args, launch.prefs, launch.headless,
launch.proxy, launch.extensions, page.script:*, page.evaluate,
raw:cdp), the rest as in new.
The default of Plugin::metadata. A plain set runs such a plugin with the
legacy grants and in the Normal phase; a strict set refuses it.
Metadata::is_declared#
fnWhether the plugin declared its metadata: category.is_some().
Metadata::version#
fnThe version, such as env!("CARGO_PKG_VERSION").
The metadata with this version.
Metadata::summary#
fnOne line about what the plugin does.
The metadata with this summary.
Metadata::capability#
fnA capability the plugin needs; added to capabilities.
The metadata with the capability.
Metadata::capabilities#
fnCapabilities the plugin needs; each is added to capabilities.
The metadata with the capabilities.
Metadata::optional#
fnA capability the plugin uses if granted; added to optional.
The metadata with the optional capability.
A plugin that can work without it handles the error where it is missing, such
as send on a browser without the DevTools Protocol.
Metadata::requires#
fnA plugin that must be in the set and run before this one.
The metadata with the edge. A missing plugin fails the check with
PluginError::MissingDependency.
Metadata::conflicts_with#
fnA plugin that may not be in the same set; added to conflicts.
The metadata with the conflict. Both in one set fail the check with
PluginError::Conflict.
Metadata::after#
fnA plugin this one runs after, when it is in the set.
The metadata with the edge. An absent plugin is ignored.
Metadata::before#
fnA plugin this one runs before, when it is in the set.
The metadata with the edge. An absent plugin is ignored.
Metadata::phase#
fnThe phase to run in, instead of the category’s default.
The metadata with phase: Some(phase). Requirements::RUN_LAST still puts the
plugin in Last.
Metadata::seal#
fnFields to seal, combined with |. They are added to the seals already set.
The metadata with the seals.
Metadata::budget#
fnThe time limits; they replace earlier ones.
The metadata with these budgets.
Category#
enum non_exhaustive seleniumbase_rs_plugin::Category
What kind of job a plugin does. It serializes in lower case ("privacy"), the
word sbrs plugin list and sbrs plugin info print.
Category::default_phase#
fnThe phase plugins of this category run in unless they say otherwise:
Environment → Prepare, Extension and Core → Normal, Privacy →
Enforce, Testing → Observe.
Phase#
enum non_exhaustive seleniumbase_rs_plugin::Phase
When, relative to other plugins, a plugin runs. The variants are ordered as declared, and the set runs lower phases first; ordering edges can override it (Run order).
Seals#
struct seleniumbase_rs_plugin::Seals
The scalar launch fields a plugin may seal against later change, combined with
|. When a plugin whose metadata holds a seal changes that field in
before_launch, a later plugin may set it again to the same value but not to
another one (PluginError::Sealed). Two plugins that seal one field to
different values cannot run together.
No seals; also Seals::default().
Whether every seal of other is set.
Budgets#
struct non_exhaustive seleniumbase_rs_plugin::Budgets
Time limits a plugin asks for. This version stores them; no code reads, caps or enforces them yet (the API’s own comment plans a timer for a later phase).