#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: TabIdThe tab’s unique identifier within the browser.
index: u32Zero-based position of the tab within its window.
window_id: WindowIdThe identifier of the window that contains this tab.
title: StringThe tab’s title.
url: StringThe URL currently loaded in the tab.
is_active: boolWhether this is the currently active (focused) tab in its window.
is_pinned: boolWhether this tab is pinned.
is_discarded: boolWhether this tab has been discarded (unloaded from memory to save resources).
is_audible: boolWhether this tab is currently producing audio.
is_muted: boolWhether this tab’s audio is muted.
status: TabStatusThe current loading status of the tab.
has_attention: boolWhether 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: boolWhether this tab is currently waiting for basic HTTP authentication credentials.
Tracked by the extension via browser.webRequest.onAuthRequired.
is_in_reader_mode: boolWhether this tab is currently displayed in Reader Mode.
Firefox-specific; will be false on browsers that do not support Reader Mode.
incognito: boolWhether this tab is open in a private/incognito window.
history_length: u32Number 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.
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.
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
impl TabDetails
Sourcepub 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
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
impl Clone for TabDetails
Source§fn clone(&self) -> TabDetails
fn clone(&self) -> TabDetails
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more