#[non_exhaustive]pub enum CliCommand {
Show 39 variants
GetBrowserInfo,
ListWindows,
OpenWindow {
title_prefix: Option<String>,
incognito: bool,
},
CloseWindow {
window_id: WindowId,
},
SetWindowTitlePrefix {
window_id: WindowId,
prefix: String,
},
RemoveWindowTitlePrefix {
window_id: WindowId,
},
ListTabs {
window_id: WindowId,
},
OpenTab {
window_id: WindowId,
insert_before_tab_id: Option<TabId>,
insert_after_tab_id: Option<TabId>,
url: Option<String>,
username: Option<String>,
password: Option<Password>,
background: bool,
cookie_store_id: Option<CookieStoreId>,
wait_for_load_timeout_ms: Option<u32>,
},
ActivateTab {
tab_id: TabId,
},
NavigateTab {
tab_id: TabId,
url: String,
},
ReloadTab {
tab_id: TabId,
bypass_cache: bool,
},
CloseTab {
tab_id: TabId,
},
PinTab {
tab_id: TabId,
},
UnpinTab {
tab_id: TabId,
},
ToggleReaderMode {
tab_id: TabId,
},
DiscardTab {
tab_id: TabId,
},
WarmupTab {
tab_id: TabId,
},
MuteTab {
tab_id: TabId,
},
UnmuteTab {
tab_id: TabId,
},
MoveTab {
tab_id: TabId,
new_index: u32,
},
GoBack {
tab_id: TabId,
steps: u32,
},
GoForward {
tab_id: TabId,
steps: u32,
},
SubscribeEvents {
include_windows_tabs: bool,
include_downloads: bool,
},
ListContainers,
ReopenTabInContainer {
tab_id: TabId,
cookie_store_id: CookieStoreId,
},
ListDownloads {
state: Option<DownloadState>,
limit: Option<u32>,
query: Option<String>,
},
StartDownload {
url: String,
filename: Option<String>,
save_as: bool,
conflict_action: Option<FilenameConflictAction>,
},
CancelDownload {
download_id: DownloadId,
},
PauseDownload {
download_id: DownloadId,
},
ResumeDownload {
download_id: DownloadId,
},
RetryDownload {
download_id: DownloadId,
},
EraseDownload {
download_id: DownloadId,
},
EraseAllDownloads {
state: Option<DownloadState>,
},
ListTabGroups {
window_id: Option<WindowId>,
},
GetTabGroup {
group_id: TabGroupId,
},
UpdateTabGroup {
group_id: TabGroupId,
title: Option<String>,
color: Option<TabGroupColor>,
collapsed: Option<bool>,
},
MoveTabGroup {
group_id: TabGroupId,
index: u32,
window_id: Option<WindowId>,
},
GroupTabs {
tab_ids: Vec<TabId>,
group_id: Option<TabGroupId>,
},
UngroupTabs {
tab_ids: Vec<TabId>,
},
}Expand description
A command sent from the CLI to the mediator, and forwarded to the extension.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GetBrowserInfo
Retrieve information about the connected browser instance.
ListWindows
List all open windows with their tab summaries.
OpenWindow
Open a new browser window.
Fields
CloseWindow
Close an existing browser window.
SetWindowTitlePrefix
Set the title prefix (Firefox titlePreface) for a window.
Firefox-only. Returns an error on browsers that do not support
titlePreface.
Fields
RemoveWindowTitlePrefix
Remove the title prefix from a window, restoring the default title.
Firefox-only. Returns an error on browsers that do not support
titlePreface.
ListTabs
List all tabs in a window with full details.
OpenTab
Open a new tab in a window.
Fields
insert_before_tab_id: Option<TabId>If set, the new tab will be inserted immediately before the tab with this ID.
insert_after_tab_id: Option<TabId>If set, the new tab will be inserted immediately after the tab with this ID.
url: Option<String>The URL to load in the new tab, or the browser’s default new-tab page if absent.
username: Option<String>Optional username for HTTP authentication.
When set (together with password), the extension opens the URL without
embedded credentials and responds to the server’s 401 challenge via the
webRequest.onAuthRequired API, injecting the credentials into the browser’s
built-in authentication cache. Subsequent requests to the same realm reuse the
cached credentials automatically. Requires url to be set.
password: Option<Password>Optional password for HTTP authentication.
Used together with username. Requires url to be set.
background: boolIf true, the new tab is created in the background and the currently active tab
in the window remains active.
Firefox container (cookie store) ID to open the tab in. Firefox-only; returns an error on browsers without container support.
E.g. "firefox-container-1".
wait_for_load_timeout_ms: Option<u32>Optional timeout in milliseconds to wait for the tab to finish loading before returning.
When set, the extension waits for tabs.onUpdated to report
status: "complete" for this tab, up to the given timeout. If the
timeout elapses, the tab details are returned in whatever state they
are in. When None, the tab details are returned immediately after
creation without waiting.
ActivateTab
Activate a tab, making it the focused tab in its window.
Navigate an existing tab to a new URL.
ReloadTab
Reload a tab.
Fields
CloseTab
Close a tab.
PinTab
Pin a tab.
UnpinTab
Unpin a tab.
ToggleReaderMode
Toggle Reader Mode for a tab.
Firefox-only. Switches the tab into or out of Reader Mode. The tab must be displaying a page that Firefox considers reader-mode compatible.
DiscardTab
Discard a tab, unloading its content from memory without closing it.
The tab remains in the tab strip but its content is freed. It will be reloaded when activated. Cannot discard the active tab.
WarmupTab
Warm up a discarded tab, loading its content into memory without activating it.
Firefox-only. Uses tabs.warmup() which is not available on Chrome.
MuteTab
Mute a tab, suppressing any audio it produces.
UnmuteTab
Unmute a tab, allowing it to produce audio again.
MoveTab
Move a tab to a new position within its window.
Fields
GoBack
Navigate backward in a tab’s session history.
Returns a CliResult::Tab with the details of the page navigated to,
or the current tab state if the history boundary was already reached.
Fields
GoForward
Navigate forward in a tab’s session history.
Returns a CliResult::Tab with the details of the page navigated to,
or the current tab state if the history boundary was already reached.
Fields
SubscribeEvents
Subscribe to a live stream of browser events.
After sending this command the mediator streams BrowserEvent objects as
newline-delimited JSON on the same connection until the client disconnects.
No CliResponse is sent; events arrive directly as BrowserEvent JSON.
When both include_windows_tabs and include_downloads are false
(the default), all event categories are delivered (backward compatible).
Fields
ListContainers
List all Firefox containers (contextual identities).
Firefox-only. Returns an error on browsers that do not support contextual identities.
ReopenTabInContainer
Close a tab and reopen its URL in a different container.
Firefox-only. The tab is closed and a new tab is created in the target container with the same URL.
ListDownloads
List downloads, optionally filtered by state.
Fields
state: Option<DownloadState>Filter by download state.
StartDownload
Start a new download.
Fields
conflict_action: Option<FilenameConflictAction>How to handle filename conflicts.
CancelDownload
Cancel an active download.
Fields
download_id: DownloadIdThe download ID to cancel.
PauseDownload
Pause an active download.
Fields
download_id: DownloadIdThe download ID to pause.
ResumeDownload
Resume a paused download.
Fields
download_id: DownloadIdThe download ID to resume.
RetryDownload
Retry an interrupted download by re-downloading from the same URL.
Fields
download_id: DownloadIdThe download ID to retry.
EraseDownload
Remove a download from the browser’s download history (the file stays on disk).
Fields
download_id: DownloadIdThe download ID to erase.
EraseAllDownloads
Clear all downloads from the browser’s history, optionally filtered by state.
Fields
state: Option<DownloadState>Only erase downloads in this state.
ListTabGroups
List all tab groups, optionally filtered by window.
Chrome-only. Returns an error on browsers that do not support tab groups.
GetTabGroup
Get a single tab group by ID.
Chrome-only.
Fields
group_id: TabGroupIdThe ID of the group to retrieve.
UpdateTabGroup
Update a tab group’s properties.
Chrome-only.
Fields
group_id: TabGroupIdThe ID of the group to update.
color: Option<TabGroupColor>New color for the group.
MoveTabGroup
Move a tab group to a new position.
Chrome-only.
Fields
group_id: TabGroupIdThe ID of the group to move.
GroupTabs
Add tabs to a tab group, optionally creating a new group.
Chrome-only.
Fields
group_id: Option<TabGroupId>The group to add the tabs to. If None, a new group is created.
UngroupTabs
Remove tabs from their tab groups.
Chrome-only.
Trait Implementations§
Source§impl Clone for CliCommand
impl Clone for CliCommand
Source§fn clone(&self) -> CliCommand
fn clone(&self) -> CliCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more