Skip to main content

CliCommand

Enum CliCommand 

Source
pub enum CliCommand {
Show 20 variants GetBrowserInfo, ListWindows, OpenWindow, CloseWindow { window_id: u32, }, SetWindowTitlePrefix { window_id: u32, prefix: String, }, RemoveWindowTitlePrefix { window_id: u32, }, ListTabs { window_id: u32, }, OpenTab { window_id: u32, insert_before_tab_id: Option<u32>, insert_after_tab_id: Option<u32>, url: Option<String>, strip_credentials: bool, }, ActivateTab { tab_id: u32, }, NavigateTab { tab_id: u32, url: String, }, CloseTab { tab_id: u32, }, PinTab { tab_id: u32, }, UnpinTab { tab_id: u32, }, WarmupTab { tab_id: u32, }, MuteTab { tab_id: u32, }, UnmuteTab { tab_id: u32, }, MoveTab { tab_id: u32, new_index: u32, }, GoBack { tab_id: u32, steps: u32, }, GoForward { tab_id: u32, steps: u32, }, SubscribeEvents,
}
Expand description

A command sent from the CLI to the mediator, and forwarded to the extension.

Variants§

§

GetBrowserInfo

Retrieve information about the connected browser instance.

§

ListWindows

List all open windows with their tab summaries.

§

OpenWindow

Open a new browser window.

§

CloseWindow

Close an existing browser window.

Fields

§window_id: u32

The ID of the window to close.

§

SetWindowTitlePrefix

Set the title prefix (Firefox titlePreface) for a window.

Fields

§window_id: u32

The ID of the window whose prefix to set.

§prefix: String

The prefix string to prepend to the window title.

§

RemoveWindowTitlePrefix

Remove the title prefix from a window, restoring the default title.

Fields

§window_id: u32

The ID of the window whose prefix to remove.

§

ListTabs

List all tabs in a window with full details.

Fields

§window_id: u32

The ID of the window whose tabs to list.

§

OpenTab

Open a new tab in a window.

Fields

§window_id: u32

The ID of the window in which to open the tab.

§insert_before_tab_id: Option<u32>

If set, the new tab will be inserted immediately before the tab with this ID.

§insert_after_tab_id: Option<u32>

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.

§strip_credentials: bool

If true, after the tab finishes loading the extension strips any user:password@ credentials from the URL and navigates to the clean URL.

This causes Firefox to cache the credentials (satisfying future auth challenges automatically) while leaving the tab displaying the URL without embedded credentials. Requires url to be set; ignored when url is absent.

§

ActivateTab

Activate a tab, making it the focused tab in its window.

Fields

§tab_id: u32

The ID of the tab to activate.

§

NavigateTab

Navigate an existing tab to a new URL.

Fields

§tab_id: u32

The ID of the tab to navigate.

§url: String

The URL to load in the tab.

§

CloseTab

Close a tab.

Fields

§tab_id: u32

The ID of the tab to close.

§

PinTab

Pin a tab.

Fields

§tab_id: u32

The ID of the tab to pin.

§

UnpinTab

Unpin a tab.

Fields

§tab_id: u32

The ID of the tab to unpin.

§

WarmupTab

Warm up a discarded tab, loading its content into memory without activating it.

Fields

§tab_id: u32

The ID of the tab to warm up.

§

MuteTab

Mute a tab, suppressing any audio it produces.

Fields

§tab_id: u32

The ID of the tab to mute.

§

UnmuteTab

Unmute a tab, allowing it to produce audio again.

Fields

§tab_id: u32

The ID of the tab to unmute.

§

MoveTab

Move a tab to a new position within its window.

Fields

§tab_id: u32

The ID of the tab to move.

§new_index: u32

The new zero-based index for the tab within its window.

§

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

§tab_id: u32

The ID of the tab to navigate.

§steps: u32

Number of steps to go back (default 1).

§

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

§tab_id: u32

The ID of the tab to navigate.

§steps: u32

Number of steps to go forward (default 1).

§

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.

Trait Implementations§

Source§

impl Clone for CliCommand

Source§

fn clone(&self) -> CliCommand

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CliCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CliCommand

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CliCommand

Source§

fn eq(&self, other: &CliCommand) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CliCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CliCommand

Source§

impl StructuralPartialEq for CliCommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,