pub struct BrowserSnapshot {
pub url: String,
pub title: String,
pub selected_text: Option<String>,
pub context: Value,
}Expand description
A snapshot of the current browser state at the moment a command is issued.
Captured by JavaScript adapters and sent to the Rust core for processing. The core never reads browser state directly — it only receives these snapshots.
The context field carries arbitrary browser data (tabs, bookmarks, history,
storage, DOM fragments, etc.) so that Rust can make decisions on any data
without the architecture needing extension-specific plumbing.
§Example
{
"url": "https://example.com",
"title": "Example",
"selected_text": null,
"context": {
"tabs": [{"id": 1, "title": "Tab 1", "url": "..."}],
"bookmarks": [{"id": "1", "title": "Saved", "url": "..."}]
}
}Fields§
§url: StringThe URL of the active tab.
title: StringThe document title of the active tab.
selected_text: Option<String>Text selected by the user, if any.
context: ValueArbitrary browser data gathered by JS before dispatch.
JS adapters populate this with whatever the extension needs: tabs, bookmarks, history, storage contents, DOM fragments, etc. Rust parses the relevant fields in each action handler.
Trait Implementations§
Source§impl Clone for BrowserSnapshot
impl Clone for BrowserSnapshot
Source§fn clone(&self) -> BrowserSnapshot
fn clone(&self) -> BrowserSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more