Skip to main content

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.

categoryOption<Category>#

The plugin’s category; None for a legacy plugin, which declares nothing.

versionCow<'static, str>#

The plugin’s version, such as env!("CARGO_PKG_VERSION"). Shown by sbrs plugin info.

Default: "empty"

summaryCow<'static, str>#

One line about what it does. Shown by sbrs plugin list and sbrs plugin info.

Default: "empty"

capabilitiesCapabilitySet#

What it needs. The check fails when the host cannot give one or the set did not grant it. See Capabilities.

Default: "empty"

optionalCapabilitySet#

What it uses when granted. Granted by default like capabilities, minus the Critical ones, and listed by the audit, but never checked.

Default: "empty"

requiresVec<Cow<'static, str>>#

Plugins that must be in the set and run before it.

Default: "empty"

conflictsVec<Cow<'static, str>>#

Plugins that may not be in the set.

Default: "empty"

afterVec<Cow<'static, str>>#

Plugins it runs after, when they are present.

Default: "empty"

beforeVec<Cow<'static, str>>#

Plugins it runs before, when they are present.

Default: "empty"

phaseOption<Phase>#

None: the category’s default phase.

Default: "None"

sealsSeals#

The scalar launch fields it seals against later change.

Default: "Seals::empty()"

budgetsBudgets#

Time limits it asks for; stored, not enforced yet.

Default: "Budgets::default()"

Metadata::new#

fn
categoryCategoryrequired#

What kind of job the plugin does.

returnMetadata#

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#

fn
returnMetadata#

An 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#

fn
returnbool#

Whether the plugin declared its metadata: category.is_some().

Metadata::version#

fn
versionimpl Into<Cow<'static, str>>required#

The version, such as env!("CARGO_PKG_VERSION").

returnMetadata#

The metadata with this version.

Metadata::summary#

fn
summaryimpl Into<Cow<'static, str>>required#

One line about what the plugin does.

returnMetadata#

The metadata with this summary.

Metadata::capability#

fn
capabilityCapabilityrequired#

A capability the plugin needs; added to capabilities.

returnMetadata#

The metadata with the capability.

Metadata::capabilities#

fn
capabilitiesimpl IntoIterator<Item = Capability>required#

Capabilities the plugin needs; each is added to capabilities.

returnMetadata#

The metadata with the capabilities.

Metadata::optional#

fn
capabilityCapabilityrequired#

A capability the plugin uses if granted; added to optional.

returnMetadata#

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#

fn
nameimpl Into<Cow<'static, str>>required#

A plugin that must be in the set and run before this one.

returnMetadata#

The metadata with the edge. A missing plugin fails the check with PluginError::MissingDependency.

Metadata::conflicts_with#

fn
nameimpl Into<Cow<'static, str>>required#

A plugin that may not be in the same set; added to conflicts.

returnMetadata#

The metadata with the conflict. Both in one set fail the check with PluginError::Conflict.

Metadata::after#

fn
nameimpl Into<Cow<'static, str>>required#

A plugin this one runs after, when it is in the set.

returnMetadata#

The metadata with the edge. An absent plugin is ignored.

Metadata::before#

fn
nameimpl Into<Cow<'static, str>>required#

A plugin this one runs before, when it is in the set.

returnMetadata#

The metadata with the edge. An absent plugin is ignored.

Metadata::phase#

fn
phasePhaserequired#

The phase to run in, instead of the category’s default.

returnMetadata#

The metadata with phase: Some(phase). Requirements::RUN_LAST still puts the plugin in Last.

Metadata::seal#

fn
sealsSealsrequired#

Fields to seal, combined with |. They are added to the seals already set.

returnMetadata#

The metadata with the seals.

Metadata::budget#

fn
budgetsBudgetsrequired#

The time limits; they replace earlier ones.

returnMetadata#

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.

Categoryenum#

Category::default_phase#

fn
returnPhase#

The 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).

Phaseenum#

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.

Sealsflags#
Seals::empty()const fn() -> Seals#

No seals; also Seals::default().

contains(self, other)const fn(Seals, Seals) -> bool#

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).

before_launchOption<Duration>#

For before_launch.

Default: "None"

on_page_createdOption<Duration>#

For on_page_created.

Default: "None"