Window class
class Window extends ChromeObject { Window({int id, bool focused, int top, int left, int width, int height, List<Tab> tabs, bool incognito, String type, String state, bool alwaysOnTop, String sessionId}) { if (id != null) this.id = id; if (focused != null) this.focused = focused; if (top != null) this.top = top; if (left != null) this.left = left; if (width != null) this.width = width; if (height != null) this.height = height; if (tabs != null) this.tabs = tabs; if (incognito != null) this.incognito = incognito; if (type != null) this.type = type; if (state != null) this.state = state; if (alwaysOnTop != null) this.alwaysOnTop = alwaysOnTop; if (sessionId != null) this.sessionId = sessionId; } Window.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); /** * The ID of the window. Window IDs are unique within a browser session. Under * some circumstances a Window may not be assigned an ID, for example when * querying windows 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; /** * Whether the window is currently the focused window. */ bool get focused => jsProxy['focused']; set focused(bool value) => jsProxy['focused'] = value; /** * The offset of the window from the top edge of the screen in pixels. Under * some circumstances a Window may not be assigned top property, for example * when querying closed windows from the [sessions] API. */ int get top => jsProxy['top']; set top(int value) => jsProxy['top'] = value; /** * The offset of the window from the left edge of the screen in pixels. Under * some circumstances a Window may not be assigned left property, for example * when querying closed windows from the [sessions] API. */ int get left => jsProxy['left']; set left(int value) => jsProxy['left'] = value; /** * The width of the window, including the frame, in pixels. Under some * circumstances a Window may not be assigned width property, for example when * querying closed windows from the [sessions] API. */ int get width => jsProxy['width']; set width(int value) => jsProxy['width'] = value; /** * The height of the window, including the frame, in pixels. Under some * circumstances a Window may not be assigned height property, for example * when querying closed windows from the [sessions] API. */ int get height => jsProxy['height']; set height(int value) => jsProxy['height'] = value; /** * Array of [tabs.Tab] objects representing the current tabs in the window. */ List<Tab> get tabs => listify(jsProxy['tabs'], _createTab); set tabs(List<Tab> value) => jsProxy['tabs'] = jsify(value); /** * Whether the window is incognito. */ bool get incognito => jsProxy['incognito']; set incognito(bool value) => jsProxy['incognito'] = value; /** * The type of browser window this is. Under some circumstances a Window may * not be assigned type property, for example when querying closed windows * from the [sessions] API. * enum of `normal`, `popup`, `panel`, `app` */ String get type => jsProxy['type']; set type(String value) => jsProxy['type'] = value; /** * The state of this browser window. Under some circumstances a Window may not * be assigned state property, for example when querying closed windows from * the [sessions] API. * enum of `normal`, `minimized`, `maximized`, `fullscreen` */ String get state => jsProxy['state']; set state(String value) => jsProxy['state'] = value; /** * Whether the window is set to be always on top. */ bool get alwaysOnTop => jsProxy['alwaysOnTop']; set alwaysOnTop(bool value) => jsProxy['alwaysOnTop'] = value; /** * The session ID used to uniquely identify a Window obtained from the * [sessions] API. */ String get sessionId => jsProxy['sessionId']; set sessionId(String value) => jsProxy['sessionId'] = value; }
Extends
ChromeObject > Window
Constructors
new Window({int id, bool focused, int top, int left, int width, int height, List<Tab> tabs, bool incognito, String type, String state, bool alwaysOnTop, String sessionId}) #
Create a new instance of a ChromeObject
, which creates and delegates to
a JsObject proxy.
Window({int id, bool focused, int top, int left, int width, int height, List<Tab> tabs, bool incognito, String type, String state, bool alwaysOnTop, String sessionId}) { if (id != null) this.id = id; if (focused != null) this.focused = focused; if (top != null) this.top = top; if (left != null) this.left = left; if (width != null) this.width = width; if (height != null) this.height = height; if (tabs != null) this.tabs = tabs; if (incognito != null) this.incognito = incognito; if (type != null) this.type = type; if (state != null) this.state = state; if (alwaysOnTop != null) this.alwaysOnTop = alwaysOnTop; if (sessionId != null) this.sessionId = sessionId; }
new Window.fromProxy(JsObject jsProxy) #
Create a new instance of a ChromeObject
, which delegates to the given
JsObject proxy.
Window.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);
Properties
bool alwaysOnTop #
Whether the window is set to be always on top.
bool get alwaysOnTop => jsProxy['alwaysOnTop'];
set alwaysOnTop(bool value) => jsProxy['alwaysOnTop'] = value;
bool focused #
Whether the window is currently the focused window.
bool get focused => jsProxy['focused'];
set focused(bool value) => jsProxy['focused'] = value;
int height #
The height of the window, including the frame, in pixels. Under some
circumstances a Window may not be assigned height property, for example
when querying closed windows from the sessions
API.
int get height => jsProxy['height'];
set height(int value) => jsProxy['height'] = value;
int id #
The ID of the window. Window IDs are unique within a browser session. Under
some circumstances a Window may not be assigned an ID, for example when
querying windows 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 window is incognito.
bool get incognito => jsProxy['incognito'];
set incognito(bool value) => jsProxy['incognito'] = value;
int left #
The offset of the window from the left edge of the screen in pixels. Under
some circumstances a Window may not be assigned left property, for example
when querying closed windows from the sessions
API.
int get left => jsProxy['left'];
set left(int value) => jsProxy['left'] = value;
String sessionId #
The session ID used to uniquely identify a Window obtained from the
sessions
API.
String get sessionId => jsProxy['sessionId'];
set sessionId(String value) => jsProxy['sessionId'] = value;
String state #
The state of this browser window. Under some circumstances a Window may not
be assigned state property, for example when querying closed windows from
the sessions
API.
enum of normal
, minimized
, maximized
, fullscreen
String get state => jsProxy['state'];
set state(String value) => jsProxy['state'] = value;
List<Tab> tabs #
Array of tabs.Tab
objects representing the current tabs in the window.
List<Tab> get tabs => listify(jsProxy['tabs'], _createTab);
set tabs(List<Tab> value) => jsProxy['tabs'] = jsify(value);
int top #
The offset of the window from the top edge of the screen in pixels. Under
some circumstances a Window may not be assigned top property, for example
when querying closed windows from the sessions
API.
int get top => jsProxy['top'];
set top(int value) => jsProxy['top'] = value;
String type #
The type of browser window this is. Under some circumstances a Window may
not be assigned type property, for example when querying closed windows
from the sessions
API.
enum of normal
, popup
, panel
, app
String get type => jsProxy['type'];
set type(String value) => jsProxy['type'] = value;
int width #
The width of the window, including the frame, in pixels. Under some
circumstances a Window may not be assigned width property, for example when
querying closed windows from the sessions
API.
int get width => jsProxy['width'];
set width(int value) => jsProxy['width'] = value;
Methods
String toString() #
Returns a string representation of this object.
String toString() => jsProxy.toString();