Skip to main content

TabDetails

Struct TabDetails 

Source
#[non_exhaustive]
pub struct TabDetails {
Show 25 fields pub id: TabId, pub index: u32, pub window_id: WindowId, pub title: String, pub url: String, pub is_active: bool, pub is_pinned: bool, pub is_discarded: bool, pub is_audible: bool, pub is_muted: bool, pub status: TabStatus, pub has_attention: bool, pub is_awaiting_auth: bool, pub is_in_reader_mode: bool, pub incognito: bool, pub history_length: u32, pub history_steps_back: Option<u32>, pub history_steps_forward: Option<u32>, pub history_hidden_count: Option<u32>, pub cookie_store_id: Option<CookieStoreId>, pub container_name: Option<String>, pub opener_tab_id: Option<TabId>, pub last_accessed: Option<u64>, pub auto_discardable: Option<bool>, pub group_id: Option<TabGroupId>,
}
Expand description

Full details about a browser tab.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: TabId

The tab’s unique identifier within the browser.

§index: u32

Zero-based position of the tab within its window.

§window_id: WindowId

The identifier of the window that contains this tab.

§title: String

The tab’s title.

§url: String

The URL currently loaded in the tab.

§is_active: bool

Whether this is the currently active (focused) tab in its window.

§is_pinned: bool

Whether this tab is pinned.

§is_discarded: bool

Whether this tab has been discarded (unloaded from memory to save resources).

§is_audible: bool

Whether this tab is currently producing audio.

§is_muted: bool

Whether this tab’s audio is muted.

§status: TabStatus

The current loading status of the tab.

§has_attention: bool

Whether this tab is drawing user attention (e.g. a modal dialog is open, including basic auth prompts).

Corresponds to the attention field in the Firefox tabs.Tab API.

§is_awaiting_auth: bool

Whether this tab is currently waiting for basic HTTP authentication credentials.

Tracked by the extension via browser.webRequest.onAuthRequired.

§is_in_reader_mode: bool

Whether this tab is currently displayed in Reader Mode.

Firefox-specific; will be false on browsers that do not support Reader Mode.

§incognito: bool

Whether this tab is open in a private/incognito window.

§history_length: u32

Number of entries in the tab’s session history (back/forward stack).

Populated via window.history.length; always available when the tab allows content script injection. May be 0 for discarded tabs or privileged pages.

§history_steps_back: Option<u32>

Number of steps that can be navigated backward from the current history entry.

None when the Navigation API (window.navigation) is unavailable (Firefox < 125 or privileged pages). When Some, equals the 0-based index of the current entry in the history stack.

§history_steps_forward: Option<u32>

Number of steps that can be navigated forward from the current history entry.

None under the same conditions as TabDetails::history_steps_back.

§history_hidden_count: Option<u32>

Number of history entries that exist but are inaccessible to the current document.

These are cross-origin entries (or entries from a different document in the same tab) that appear in the joint session history but are hidden from the Navigation API for security reasons. Computed as window.history.length − navigation.entries().length when the Navigation API is available.

Some(0) means the Navigation API is available and all entries are accessible. None means the Navigation API is unavailable so the split cannot be determined; in that case TabDetails::history_length already reflects the full total.

§cookie_store_id: Option<CookieStoreId>

The cookie store (container) ID this tab belongs to.

Firefox-specific; None on browsers that don’t support containers.

§container_name: Option<String>

The human-readable container name (e.g. “Work”, “Personal”).

Firefox-specific; None on browsers that don’t support containers.

§opener_tab_id: Option<TabId>

The ID of the tab that opened this one, if any.

None when the tab was not opened by another tab (e.g. opened via the address bar, bookmarks, or the tabs open command).

§last_accessed: Option<u64>

Timestamp (milliseconds since epoch) of the last user interaction.

Firefox-specific; None on browsers that don’t track this.

§auto_discardable: Option<bool>

Whether the browser can auto-discard this tab to save memory.

Chrome-specific; None on browsers that don’t support this.

§group_id: Option<TabGroupId>

Tab group ID, or None if this tab is not in a group.

Chrome-specific; None on browsers that don’t support tab groups.

Implementations§

Source§

impl TabDetails

Source

pub const fn new( id: TabId, index: u32, window_id: WindowId, title: String, url: String, is_active: bool, is_pinned: bool, is_discarded: bool, is_audible: bool, is_muted: bool, status: TabStatus, has_attention: bool, is_awaiting_auth: bool, is_in_reader_mode: bool, incognito: bool, history_length: u32, history_steps_back: Option<u32>, history_steps_forward: Option<u32>, history_hidden_count: Option<u32>, cookie_store_id: Option<CookieStoreId>, container_name: Option<String>, opener_tab_id: Option<TabId>, last_accessed: Option<u64>, auto_discardable: Option<bool>, group_id: Option<TabGroupId>, ) -> Self

Create a new TabDetails.

Trait Implementations§

Source§

impl Clone for TabDetails

Source§

fn clone(&self) -> TabDetails

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 TabDetails

Source§

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

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

impl<'de> Deserialize<'de> for TabDetails

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 TabDetails

Source§

fn eq(&self, other: &TabDetails) -> 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 TabDetails

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 TabDetails

Source§

impl StructuralPartialEq for TabDetails

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>,