#[non_exhaustive]pub enum BrowserEvent {
Show 20 variants
WindowOpened {
window_id: WindowId,
title: String,
},
WindowClosed {
window_id: WindowId,
},
TabActivated {
window_id: WindowId,
tab_id: TabId,
previous_tab_id: Option<TabId>,
},
TabOpened {
tab_id: TabId,
window_id: WindowId,
index: u32,
url: String,
title: String,
},
TabClosed {
tab_id: TabId,
window_id: WindowId,
is_window_closing: bool,
},
TabNavigated {
tab_id: TabId,
window_id: WindowId,
url: String,
},
TabTitleChanged {
tab_id: TabId,
window_id: WindowId,
title: String,
},
TabStatusChanged {
tab_id: TabId,
window_id: WindowId,
status: TabStatus,
},
DownloadCreated {
download_id: DownloadId,
url: String,
filename: String,
mime: Option<String>,
},
DownloadChanged {
download_id: DownloadId,
state: Option<DownloadState>,
filename: Option<String>,
error: Option<String>,
},
DownloadErased {
download_id: DownloadId,
},
TabMoved {
tab_id: TabId,
window_id: WindowId,
from_index: u32,
to_index: u32,
},
TabAttached {
tab_id: TabId,
new_window_id: WindowId,
new_index: u32,
},
TabDetached {
tab_id: TabId,
old_window_id: WindowId,
old_index: u32,
},
WindowFocusChanged {
window_id: Option<WindowId>,
},
TabGroupCreated {
group_id: TabGroupId,
window_id: WindowId,
title: String,
color: String,
collapsed: bool,
},
TabGroupUpdated {
group_id: TabGroupId,
window_id: WindowId,
title: String,
color: String,
collapsed: bool,
},
TabGroupRemoved {
group_id: TabGroupId,
window_id: WindowId,
},
ExtensionError {
kind: String,
message: String,
detail: String,
},
EventsLost {
count: u64,
},
}Expand description
An event emitted by the browser extension and broadcast to all event-stream subscribers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WindowOpened
A new browser window was opened.
Fields
WindowClosed
A browser window was closed.
TabActivated
The active tab in a window changed.
Fields
TabOpened
A new tab was opened.
Fields
TabClosed
A tab was closed.
Fields
A tab started loading a new URL.
TabTitleChanged
A tab’s title changed.
Fields
TabStatusChanged
A tab’s loading status changed (e.g. from loading to complete).
Fields
DownloadCreated
A new download was started.
Fields
download_id: DownloadIdThe download’s ID.
DownloadChanged
A download’s state or properties changed.
Fields
download_id: DownloadIdThe download’s ID.
state: Option<DownloadState>The new state, if it changed.
DownloadErased
A download was removed from the browser’s history.
Fields
download_id: DownloadIdThe download’s ID.
TabMoved
A tab was moved to a new position within its window.
Fields
TabAttached
A tab was attached to a window (moved from another window).
Fields
TabDetached
A tab was detached from a window (being moved to another window).
Fields
WindowFocusChanged
The focused window changed.
Fields
TabGroupCreated
A tab group was created. Chrome-only.
Fields
group_id: TabGroupIdThe new group’s ID.
TabGroupUpdated
A tab group’s properties changed. Chrome-only.
Fields
group_id: TabGroupIdThe updated group’s ID.
TabGroupRemoved
A tab group was removed. Chrome-only.
Fields
group_id: TabGroupIdThe removed group’s ID.
ExtensionError
An uncaught error or unhandled promise rejection occurred in the extension’s service worker.
These are forwarded from the extension’s global error handlers so they are visible in the mediator log and event stream.
Fields
EventsLost
Some events were lost because the consumer could not keep up.
This is a synthetic event generated by the mediator, not the browser. The consumer should assume that any cached state may be stale and re-query if needed.
Implementations§
Source§impl BrowserEvent
impl BrowserEvent
Sourcepub const fn is_download_event(&self) -> bool
pub const fn is_download_event(&self) -> bool
Returns true if this is a download-related event.
Sourcepub const fn matches_filter(
&self,
include_windows_tabs: bool,
include_downloads: bool,
) -> bool
pub const fn matches_filter( &self, include_windows_tabs: bool, include_downloads: bool, ) -> bool
Returns true if this event passes the given subscription filter.
When both include_windows_tabs and include_downloads are false,
all events pass (backward compatible “no filter” mode).
Trait Implementations§
Source§impl Clone for BrowserEvent
impl Clone for BrowserEvent
Source§fn clone(&self) -> BrowserEvent
fn clone(&self) -> BrowserEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more