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
Static Fields
Methods
Code void blur() #
void blur();
Code void captureEvents() #
void captureEvents();
Code void close() #
void close();
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 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 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 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 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 PagePopupController pagePopupController #
final PagePopupController pagePopupController;
Code final Performance performance #
final Performance performance;
Code final StyleMedia styleMedia #
final StyleMedia styleMedia;
Code final IDBFactory webkitIndexedDB #
final IDBFactory webkitIndexedDB;
Code final NotificationCenter webkitNotifications #
final NotificationCenter webkitNotifications;
Code final StorageInfo webkitStorageInfo #
final StorageInfo webkitStorageInfo;
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.