Tab constructor
Tab({
- int? id,
- required int index,
- required int groupId,
- required int windowId,
- int? openerTabId,
- required bool selected,
- double? lastAccessed,
- required bool highlighted,
- required bool active,
- required bool pinned,
- bool? audible,
- required bool discarded,
- required bool autoDiscardable,
- MutedInfo? mutedInfo,
- String? url,
- String? pendingUrl,
- String? title,
- String? favIconUrl,
- TabStatus? status,
- required bool incognito,
- int? width,
- int? height,
- String? sessionId,
Implementation
Tab({
/// The ID of the tab. Tab IDs are unique within a browser session. Under
/// some circumstances a tab may not be assigned an ID; for example, when
/// querying foreign tabs using the [sessions] API, in which case a session
/// ID may be present. Tab ID can also be set to `chrome.tabs.TAB_ID_NONE`
/// for apps and devtools windows.
int? id,
/// The zero-based index of the tab within its window.
required int index,
/// The ID of the group that the tab belongs to.
required int groupId,
/// The ID of the window that contains the tab.
required int windowId,
/// The ID of the tab that opened this tab, if any. This property is only
/// present if the opener tab still exists.
int? openerTabId,
/// Whether the tab is selected.
required bool selected,
/// The last time the tab was accessed as the number of milliseconds since
/// epoch.
double? lastAccessed,
/// Whether the tab is highlighted.
required bool highlighted,
/// Whether the tab is active in its window. Does not necessarily mean the
/// window is focused.
required bool active,
/// Whether the tab is pinned.
required bool pinned,
/// Whether the tab has produced sound over the past couple of seconds (but
/// it might not be heard if also muted). Equivalent to whether the 'speaker
/// audio' indicator is showing.
bool? audible,
/// Whether the tab is discarded. A discarded tab is one whose content has
/// been unloaded from memory, but is still visible in the tab strip. Its
/// content is reloaded the next time it is activated.
required bool discarded,
/// Whether the tab can be discarded automatically by the browser when
/// resources are low.
required bool autoDiscardable,
/// The tab's muted state and the reason for the last state change.
MutedInfo? mutedInfo,
/// The last committed URL of the main frame of the tab. This property is
/// only present if the extension's manifest includes the `"tabs"`
/// permission and may be an empty string if the tab has not yet committed.
/// See also [Tab.pendingUrl].
String? url,
/// The URL the tab is navigating to, before it has committed. This property
/// is only present if the extension's manifest includes the `"tabs"`
/// permission and there is a pending navigation.
String? pendingUrl,
/// The title of the tab. This property is only present if the extension's
/// manifest includes the `"tabs"` permission.
String? title,
/// The URL of the tab's favicon. This property is only present if the
/// extension's manifest includes the `"tabs"` permission. It may also be an
/// empty string if the tab is loading.
String? favIconUrl,
/// The tab's loading status.
TabStatus? status,
/// Whether the tab is in an incognito window.
required bool incognito,
/// The width of the tab in pixels.
int? width,
/// The height of the tab in pixels.
int? height,
/// The session ID used to uniquely identify a tab obtained from the
/// [sessions] API.
String? sessionId,
}) : _wrapped = $js.Tab(
id: id,
index: index,
groupId: groupId,
windowId: windowId,
openerTabId: openerTabId,
selected: selected,
lastAccessed: lastAccessed,
highlighted: highlighted,
active: active,
pinned: pinned,
audible: audible,
discarded: discarded,
autoDiscardable: autoDiscardable,
mutedInfo: mutedInfo?.toJS,
url: url,
pendingUrl: pendingUrl,
title: title,
favIconUrl: favIconUrl,
status: status?.toJS,
incognito: incognito,
width: width,
height: height,
sessionId: sessionId,
);