android-components / mozilla.components.browser.state.state / BrowserState

BrowserState

data class BrowserState : State (source)

Value type that represents the complete state of the browser/engine.

Constructors

Name Summary
<init> BrowserState(tabs: List<TabSessionState> = emptyList(), selectedTabId: String? = null, customTabs: List<CustomTabSessionState> = emptyList(), extensions: Map<String, WebExtensionState> = emptyMap())
Value type that represents the complete state of the browser/engine.

Properties

Name Summary
customTabs val customTabs: List<CustomTabSessionState>
the list of custom tabs, defaults to an empty list.
extensions val extensions: Map<String, WebExtensionState>
A map of extension ids and web extensions of all installed web extensions. The extensions here represent the default values for all BrowserState.extensions and can be overridden per SessionState.
selectedTabId val selectedTabId: String?
the ID of the currently selected (active) tab.
tabs val tabs: List<TabSessionState>
the list of open tabs, defaults to an empty list.

Extension Properties

Name Summary
normalTabs val BrowserState.normalTabs: List<TabSessionState>
List of normal (non-private) tabs.
privateTabs val BrowserState.privateTabs: List<TabSessionState>
List of private tabs.
selectedTab val BrowserState.selectedTab: TabSessionState?
The currently selected tab if there’s one.

Extension Functions

Name Summary
findCustomTab fun BrowserState.findCustomTab(tabId: String): CustomTabSessionState?
Finds and returns the Custom Tab with the given id. Returns null if no matching tab could be found.
findCustomTabOrSelectedTab fun BrowserState.findCustomTabOrSelectedTab(customTabId: String? = null): SessionState?
Finds and returns the tab with the given id or the selected tab if no id was provided (null). Returns null if no matching tab could be found or if no selected tab exists.
findTab fun BrowserState.findTab(tabId: String): TabSessionState?
Finds and returns the tab with the given id. Returns null if no matching tab could be found.
findTabOrCustomTab fun BrowserState.findTabOrCustomTab(tabId: String): SessionState?
Finds and returns the TabSessionState or CustomTabSessionState with the given tabId.