Tab constructor

Tab({
  1. int? id,
  2. required int index,
  3. required int groupId,
  4. required int windowId,
  5. int? openerTabId,
  6. required bool selected,
  7. double? lastAccessed,
  8. required bool highlighted,
  9. required bool active,
  10. required bool pinned,
  11. bool? audible,
  12. required bool discarded,
  13. required bool autoDiscardable,
  14. MutedInfo? mutedInfo,
  15. String? url,
  16. String? pendingUrl,
  17. String? title,
  18. String? favIconUrl,
  19. TabStatus? status,
  20. required bool incognito,
  21. int? width,
  22. int? height,
  23. 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,
      );