Dart API Referencedart:htmlWindow

Window Interface

This section provides a brief reference for all of the methods, properties, and events available through the DOM window object. The window object implements the Window interface, which in turn inherits from the AbstractView interface. Some additional global functions, namespaces objects, and constructors, not typically associated with the window, but available on it, are listed in the JavaScript Reference.

The window object represents the window itself. The document property of a window points to the DOM document loaded in that window. A window for a given document can be obtained using the document.defaultView property.

In a tabbed browser, such as Firefox, each tab contains its own window object (and if you're writing an extension, the browser window itself is a separate window too - see Working with windows in chrome code for more information). That is, the window object is not shared between tabs in the same window. Some methods, namely window.resizeTo and window.resizeBy apply to the whole window and not to the specific tab the window object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.

Extends

EventTarget

Static Fields

Code final int PERSISTENT #

static final int PERSISTENT = 1;

Code final int TEMPORARY #

static final int TEMPORARY = 0;

Methods

Code void alert(String message) #

void alert(String message);

Code String atob(String string) #

String atob(String string);

Code void blur() #

void blur();

Code String btoa(String string) #

String btoa(String string);

Code void cancelAnimationFrame(int id) #

void cancelAnimationFrame(int id);

Code void captureEvents() #

void captureEvents();

Code void clearInterval(int handle) #

void clearInterval(int handle);

Code void clearTimeout(int handle) #

void clearTimeout(int handle);

Code void close() #

void close();

Code bool confirm(String message) #

bool confirm(String message);

Code bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) #

bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog);

Code void focus() #

void focus();

Code CSSRuleList getMatchedCSSRules(Element element, String pseudoElement) #

CSSRuleList getMatchedCSSRules(Element element, String pseudoElement);

Code DOMSelection getSelection() #

DOMSelection getSelection();

Code IDBFactory get indexedDB() #

IDBFactory get indexedDB();

Code SendPortSync lookupPort(String name) #

Lookup a port by its name. Return null if no port is registered under name.

SendPortSync lookupPort(String name);

Code MediaQueryList matchMedia(String query) #

MediaQueryList matchMedia(String query);

Code void moveBy(num x, num y) #

void moveBy(num x, num y);

Code void moveTo(num x, num y) #

void moveTo(num x, num y);

Code WindowEvents get on() #

WindowEvents get on();

Code Window open(String url, String name, [String options]) #

Window open(String url, String name, [String options]);

Code Database openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) #

Database openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]);

Code void postMessage(message, String targetOrigin, [List messagePorts]) #

void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]);

Code void print() #

void print();

Code String prompt(String message, String defaultValue) #

String prompt(String message, String defaultValue);

Code void registerPort(String name, SendPortSync port) #

Register a port on this window under the given name. This port may be retrieved by any isolate (or JavaScript script) running in this window.

void registerPort(String name, SendPortSync port);

Code void releaseEvents() #

void releaseEvents();

Code int requestAnimationFrame(RequestAnimationFrameCallback callback) #

int requestAnimationFrame(RequestAnimationFrameCallback callback);

Code void requestLayoutFrame(TimeoutHandler callback) #

Executes a callback after the next batch of browser layout measurements has completed or would have completed if any browser layout measurements had been scheduled.

void requestLayoutFrame(TimeoutHandler callback);

Code void resizeBy(num x, num y) #

void resizeBy(num x, num y);

Code void resizeTo(num width, num height) #

void resizeTo(num width, num height);

Code void scroll(int x, int y) #

void scroll(int x, int y);

Code void scrollBy(int x, int y) #

void scrollBy(int x, int y);

Code void scrollTo(int x, int y) #

void scrollTo(int x, int y);

Code int setInterval(TimeoutHandler handler, int timeout) #

int setInterval(TimeoutHandler handler, int timeout);

Code int setTimeout(TimeoutHandler handler, int timeout) #

int setTimeout(TimeoutHandler handler, int timeout);

Code Object showModalDialog(String url, [Object dialogArgs, String featureArgs]) #

Object showModalDialog(String url, [Object dialogArgs, String featureArgs]);

Code void stop() #

void stop();

Code void webkitCancelAnimationFrame(int id) #

void webkitCancelAnimationFrame(int id);

Code void webkitCancelRequestAnimationFrame(int id) #

void webkitCancelRequestAnimationFrame(int id);

Code Point webkitConvertPointFromNodeToPage(Node node, Point p) #

Point webkitConvertPointFromNodeToPage(Node node, Point p);

Code Point webkitConvertPointFromPageToNode(Node node, Point p) #

Point webkitConvertPointFromPageToNode(Node node, Point p);

Code void webkitPostMessage(message, String targetOrigin, [List transferList]) #

void webkitPostMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List transferList]);

Code int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback) #

int webkitRequestAnimationFrame(RequestAnimationFrameCallback callback);

Code void webkitRequestFileSystem(int type, int size, FileSystemCallback successCallback, [ErrorCallback errorCallback]) #

void webkitRequestFileSystem(int type, int size, FileSystemCallback successCallback, [ErrorCallback errorCallback]);

Code void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallback, ErrorCallback errorCallback]) #

void webkitResolveLocalFileSystemURL(String url, [EntryCallback successCallback, ErrorCallback errorCallback]);

Code void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_addEventListener(String type, EventListener listener, [bool useCapture]);

Code bool $dom_dispatchEvent(Event evt) #

bool $dom_dispatchEvent(Event evt);

Code CSSStyleDeclaration $dom_getComputedStyle(Element element, String pseudoElement) #

CSSStyleDeclaration $dom_getComputedStyle(Element element, String pseudoElement);

Code void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) #

void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]);

Fields

Code final DOMApplicationCache applicationCache #

final DOMApplicationCache applicationCache;

Code final Navigator clientInformation #

final Navigator clientInformation;

Code final bool closed #

final bool closed;

Code final Console console #

final Console console;

Code final Crypto crypto #

final Crypto crypto;

Code String defaultStatus #

String defaultStatus;

Code String defaultstatus #

String defaultstatus;

Code final num devicePixelRatio #

final num devicePixelRatio;

Code final Document document #

final Document document;

Code final Event event #

final Event event;

Code final Window frames #

final Window frames;

Code final History history #

final History history;

Code final int innerHeight #

final int innerHeight;

Code final int innerWidth #

final int innerWidth;

Code final int length #

final int length;

Code final Storage localStorage #

final Storage localStorage;

Code Location location #

Location location;

Code final BarInfo locationbar #

final BarInfo locationbar;
final BarInfo menubar;

Code String name #

String name;
final Navigator navigator;

Code final bool offscreenBuffering #

final bool offscreenBuffering;

Code final Window opener #

final Window opener;

Code final int outerHeight #

final int outerHeight;

Code final int outerWidth #

final int outerWidth;

Code final PagePopupController pagePopupController #

final PagePopupController pagePopupController;

Code final int pageXOffset #

final int pageXOffset;

Code final int pageYOffset #

final int pageYOffset;

Code final Window parent #

final Window parent;

Code final Performance performance #

final Performance performance;

Code final BarInfo personalbar #

final BarInfo personalbar;

Code final Screen screen #

final Screen screen;

Code final int screenLeft #

final int screenLeft;

Code final int screenTop #

final int screenTop;

Code final int screenX #

final int screenX;

Code final int screenY #

final int screenY;

Code final int scrollX #

final int scrollX;

Code final int scrollY #

final int scrollY;

Code final BarInfo scrollbars #

final BarInfo scrollbars;

Code final Window self #

final Window self;

Code final Storage sessionStorage #

final Storage sessionStorage;

Code String status #

String status;

Code final BarInfo statusbar #

final BarInfo statusbar;

Code final StyleMedia styleMedia #

final StyleMedia styleMedia;

Code final BarInfo toolbar #

final BarInfo toolbar;

Code final Window top #

final Window top;

Code final IDBFactory webkitIndexedDB #

final IDBFactory webkitIndexedDB;

Code final NotificationCenter webkitNotifications #

final NotificationCenter webkitNotifications;

Code final StorageInfo webkitStorageInfo #

final StorageInfo webkitStorageInfo;

Code final Window window #

final Window window;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.