Tab constructor

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

  /// 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 became active in its window as the number of
  /// milliseconds since epoch.
  required 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 frozen. A frozen tab cannot execute tasks, including
  /// event handlers or timers. It is visible in the tab strip and its content
  /// is loaded in memory.  It is unfrozen on activation.
  required bool frozen,

  /// 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 has the `"tabs"` permission or has host
  /// permissions for the page. 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 has the `"tabs"` permission or has host
  /// permissions for the page and there is a pending navigation.
  String? pendingUrl,

  /// The title of the tab. This property is only present if the extension has
  /// the `"tabs"` permission or has host permissions for the page.
  String? title,

  /// The URL of the tab's favicon. This property is only present if the
  /// extension has the `"tabs"` permission or has host permissions for the
  /// page. 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,
        splitViewId: splitViewId,
        windowId: windowId,
        openerTabId: openerTabId,
        selected: selected,
        lastAccessed: lastAccessed,
        highlighted: highlighted,
        active: active,
        pinned: pinned,
        audible: audible,
        frozen: frozen,
        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,
      );