Dart Documentationchrome.tabsTab

Tab class

class Tab extends ChromeObject {
 Tab({int id, int index, int windowId, int openerTabId, bool highlighted, bool active, bool pinned, String url, String title, String favIconUrl, String status, bool incognito, int width, int height, String sessionId}) {
   if (id != null) this.id = id;
   if (index != null) this.index = index;
   if (windowId != null) this.windowId = windowId;
   if (openerTabId != null) this.openerTabId = openerTabId;
   if (highlighted != null) this.highlighted = highlighted;
   if (active != null) this.active = active;
   if (pinned != null) this.pinned = pinned;
   if (url != null) this.url = url;
   if (title != null) this.title = title;
   if (favIconUrl != null) this.favIconUrl = favIconUrl;
   if (status != null) this.status = status;
   if (incognito != null) this.incognito = incognito;
   if (width != null) this.width = width;
   if (height != null) this.height = height;
   if (sessionId != null) this.sessionId = sessionId;
 }
 Tab.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * 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.
  */
 int get id => jsProxy['id'];
 set id(int value) => jsProxy['id'] = value;

 /**
  * The zero-based index of the tab within its window.
  */
 int get index => jsProxy['index'];
 set index(int value) => jsProxy['index'] = value;

 /**
  * The ID of the window the tab is contained within.
  */
 int get windowId => jsProxy['windowId'];
 set windowId(int value) => jsProxy['windowId'] = value;

 /**
  * The ID of the tab that opened this tab, if any. This property is only
  * present if the opener tab still exists.
  */
 int get openerTabId => jsProxy['openerTabId'];
 set openerTabId(int value) => jsProxy['openerTabId'] = value;

 /**
  * Whether the tab is highlighted.
  */
 bool get highlighted => jsProxy['highlighted'];
 set highlighted(bool value) => jsProxy['highlighted'] = value;

 /**
  * Whether the tab is active in its window. (Does not necessarily mean the
  * window is focused.)
  */
 bool get active => jsProxy['active'];
 set active(bool value) => jsProxy['active'] = value;

 /**
  * Whether the tab is pinned.
  */
 bool get pinned => jsProxy['pinned'];
 set pinned(bool value) => jsProxy['pinned'] = value;

 /**
  * The URL the tab is displaying. This property is only present if the
  * extension's manifest includes the `"tabs"` permission.
  */
 String get url => jsProxy['url'];
 set url(String value) => jsProxy['url'] = value;

 /**
  * The title of the tab. This property is only present if the extension's
  * manifest includes the `"tabs"` permission.
  */
 String get title => jsProxy['title'];
 set title(String value) => jsProxy['title'] = value;

 /**
  * 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 get favIconUrl => jsProxy['favIconUrl'];
 set favIconUrl(String value) => jsProxy['favIconUrl'] = value;

 /**
  * Either _loading_ or _complete_.
  */
 String get status => jsProxy['status'];
 set status(String value) => jsProxy['status'] = value;

 /**
  * Whether the tab is in an incognito window.
  */
 bool get incognito => jsProxy['incognito'];
 set incognito(bool value) => jsProxy['incognito'] = value;

 /**
  * The width of the tab in pixels.
  */
 int get width => jsProxy['width'];
 set width(int value) => jsProxy['width'] = value;

 /**
  * The height of the tab in pixels.
  */
 int get height => jsProxy['height'];
 set height(int value) => jsProxy['height'] = value;

 /**
  * The session ID used to uniquely identify a Tab obtained from the [sessions]
  * API.
  */
 String get sessionId => jsProxy['sessionId'];
 set sessionId(String value) => jsProxy['sessionId'] = value;
}

Extends

ChromeObject > Tab

Constructors

new Tab({int id, int index, int windowId, int openerTabId, bool highlighted, bool active, bool pinned, String url, String title, String favIconUrl, String status, bool incognito, int width, int height, String sessionId}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
Tab({int id, int index, int windowId, int openerTabId, bool highlighted, bool active, bool pinned, String url, String title, String favIconUrl, String status, bool incognito, int width, int height, String sessionId}) {
 if (id != null) this.id = id;
 if (index != null) this.index = index;
 if (windowId != null) this.windowId = windowId;
 if (openerTabId != null) this.openerTabId = openerTabId;
 if (highlighted != null) this.highlighted = highlighted;
 if (active != null) this.active = active;
 if (pinned != null) this.pinned = pinned;
 if (url != null) this.url = url;
 if (title != null) this.title = title;
 if (favIconUrl != null) this.favIconUrl = favIconUrl;
 if (status != null) this.status = status;
 if (incognito != null) this.incognito = incognito;
 if (width != null) this.width = width;
 if (height != null) this.height = height;
 if (sessionId != null) this.sessionId = sessionId;
}

new Tab.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
Tab.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

bool active #

Whether the tab is active in its window. (Does not necessarily mean the window is focused.)

bool get active => jsProxy['active'];
set active(bool value) => jsProxy['active'] = value;

String favIconUrl #

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 get favIconUrl => jsProxy['favIconUrl'];
set favIconUrl(String value) => jsProxy['favIconUrl'] = value;

int height #

The height of the tab in pixels.

int get height => jsProxy['height'];
set height(int value) => jsProxy['height'] = value;

bool highlighted #

Whether the tab is highlighted.

bool get highlighted => jsProxy['highlighted'];
set highlighted(bool value) => jsProxy['highlighted'] = value;

int id #

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.

int get id => jsProxy['id'];
set id(int value) => jsProxy['id'] = value;

bool incognito #

Whether the tab is in an incognito window.

bool get incognito => jsProxy['incognito'];
set incognito(bool value) => jsProxy['incognito'] = value;

int index #

The zero-based index of the tab within its window.

int get index => jsProxy['index'];
set index(int value) => jsProxy['index'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

int openerTabId #

The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.

int get openerTabId => jsProxy['openerTabId'];
set openerTabId(int value) => jsProxy['openerTabId'] = value;

bool pinned #

Whether the tab is pinned.

bool get pinned => jsProxy['pinned'];
set pinned(bool value) => jsProxy['pinned'] = value;

String sessionId #

The session ID used to uniquely identify a Tab obtained from the sessions API.

String get sessionId => jsProxy['sessionId'];
set sessionId(String value) => jsProxy['sessionId'] = value;

String status #

Either loading or complete.

String get status => jsProxy['status'];
set status(String value) => jsProxy['status'] = value;

String title #

The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission.

String get title => jsProxy['title'];
set title(String value) => jsProxy['title'] = value;

String url #

The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission.

String get url => jsProxy['url'];
set url(String value) => jsProxy['url'] = value;

int width #

The width of the tab in pixels.

int get width => jsProxy['width'];
set width(int value) => jsProxy['width'] = value;

int windowId #

The ID of the window the tab is contained within.

int get windowId => jsProxy['windowId'];
set windowId(int value) => jsProxy['windowId'] = value;

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();