haXe API Documentation
Back | Index
extern class js.html.DOMWindow
extends EventTarget
Available in js

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.



Documentation for this class was provided by MDN.
var applicationCache(default,null) : DOMApplicationCache
An nsIDOMOfflineResourceList object providing access to the offline resources for the window.
var clientInformation(default,null) : Navigator
var closed(default,null) : Bool
This property indicates whether the current window is closed or not.
window.Components
The entry point to many XPCOM features. Some properties, e.g. classes, are only available to sufficiently privileged code.
var console(default,null) : Console
var crypto(default,null) : Crypto
Returns the browser crypto object.
var defaultStatus : String
Gets/sets the status bar text for the given window.
var defaultstatus : String
var devicePixelRatio(default,null) : Float
var document(default,null) : Document
Returns a reference to the document that the window contains.
var event(default,null) : Event
var frameElement(default,null) : Element
Returns the element in which the window is embedded, or null if the window is not embedded.
var frames(default,null) : DOMWindow
Returns an array of the subframes in the current window.
var history(default,null) : History
Returns a reference to the history object.
var indexedDB(default,null) : js.html.idb.Factory
var innerHeight(default,null) : Int
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
var innerWidth(default,null) : Int
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
var length(default,null) : Int
Returns the number of frames in the window. See also window.frames .
var localStorage(default,null) : Storage
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it. Getter throws DOMException.
var location : Location
Gets/sets the location, or current URL, of the window object.
var locationbar(default,null) : BarInfo
Returns the locationbar object, whose visibility can be toggled in the window.
var menubar(default,null) : BarInfo
Returns the menubar object, whose visibility can be toggled in the window.
var name : String
Gets/sets the name of the window.
var navigator(default,null) : Navigator
Returns a reference to the navigator object.
var notifications(default,null) : NotificationCenter
var offscreenBuffering(default,null) : Bool
var onabort : EventListener
An event handler property for abort events on the window.
var onanimationend : EventListener
var onanimationiteration : EventListener
var onanimationstart : EventListener
var onbeforeunload : EventListener
An event handler property for before-unload events on the window.
var onblur : EventListener
An event handler property for blur events on the window.
var oncanplay : EventListener
var oncanplaythrough : EventListener
var onchange : EventListener
An event handler property for change events on the window.
var onclick : EventListener
An event handler property for click events on the window.
var oncontextmenu : EventListener
An event handler property for right-click events on the window.
var ondblclick : EventListener
var ondevicemotion : EventListener
var ondeviceorientation : EventListener
var ondrag : EventListener
var ondragend : EventListener
var ondragenter : EventListener
var ondragleave : EventListener
var ondragover : EventListener
var ondragstart : EventListener
var ondrop : EventListener
var ondurationchange : EventListener
var onemptied : EventListener
var onended : EventListener
var onerror : EventListener
An event handler property for errors raised on the window.
var onfocus : EventListener
An event handler property for focus events on the window.
var onhashchange : EventListener
An event handler property for hash change events on the window; called when the part of the URL after the hash mark ("#") changes.
var oninput : EventListener
var oninvalid : EventListener
var onkeydown : EventListener
An event handler property for keydown events on the window.
var onkeypress : EventListener
An event handler property for keypress events on the window.
var onkeyup : EventListener
An event handler property for keyup events on the window.
var onload : EventListener
An event handler property for window loading.
var onloadeddata : EventListener
var onloadedmetadata : EventListener
var onloadstart : EventListener
var onmessage : EventListener
var onmousedown : EventListener
An event handler property for mousedown events on the window.
var onmousemove : EventListener
An event handler property for mousemove events on the window.
var onmouseout : EventListener
An event handler property for mouseout events on the window.
var onmouseover : EventListener
An event handler property for mouseover events on the window.
var onmouseup : EventListener
An event handler property for mouseup events on the window.
var onmousewheel : EventListener
var onoffline : EventListener
var ononline : EventListener
var onpagehide : EventListener
An event handler property for pagehide events on the window.
var onpageshow : EventListener
An event handler property for pageshow events on the window.
var onpause : EventListener
var onplay : EventListener
var onplaying : EventListener
var onpopstate : EventListener
An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object.
var onprogress : EventListener
var onratechange : EventListener
var onreset : EventListener
An event handler property for reset events on the window.
var onresize : EventListener
An event handler property for window resizing.
var onscroll : EventListener
An event handler property for window scrolling.
var onsearch : EventListener
var onseeked : EventListener
var onseeking : EventListener
var onselect : EventListener
An event handler property for window selection.
var onstalled : EventListener
var onstorage : EventListener
var onsubmit : EventListener
An event handler property for submits on window forms.
var onsuspend : EventListener
var ontimeupdate : EventListener
var ontouchcancel : EventListener
var ontouchend : EventListener
var ontouchmove : EventListener
var ontouchstart : EventListener
var ontransitionend : EventListener
var onunload : EventListener
An event handler property for unload events on the window.
var onvolumechange : EventListener
var onwaiting : EventListener
var opener(default,null) : DOMWindow
Returns a reference to the window that opened this current window.
var outerHeight(default,null) : Int
Gets the height of the outside of the browser window.
var outerWidth(default,null) : Int
Gets the width of the outside of the browser window.
var pagePopupController(default,null) : PagePopupController
var pageXOffset(default,null) : Int
An alias for window.scrollX .
var pageYOffset(default,null) : Int
An alias for window.scrollY
var parent(default,null) : DOMWindow
Returns a reference to the parent of the current window or subframe.
var performance(default,null) : Performance
var personalbar(default,null) : BarInfo
Returns the personalbar object, whose visibility can be toggled in the window.
var screen(default,null) : Screen
Returns a reference to the screen object associated with the window.
var screenLeft(default,null) : Int
var screenTop(default,null) : Int
var screenX(default,null) : Int
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
var screenY(default,null) : Int
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
var scrollX(default,null) : Int
Returns the number of pixels that the document has already been scrolled horizontally.
var scrollY(default,null) : Int
Returns the number of pixels that the document has already been scrolled vertically.
var scrollbars(default,null) : BarInfo
Returns the scrollbars object, whose visibility can be toggled in the window.
var self(default,null) : DOMWindow
Returns an object reference to the window object itself.
var sessionStorage(default,null) : Storage
A storage object for storing data within a single page session. Getter throws DOMException.
var status : String
Gets/sets the text in the statusbar at the bottom of the browser.
var statusbar(default,null) : BarInfo
Returns the statusbar object, whose visibility can be toggled in the window.
var storageInfo(default,null) : StorageInfo
var styleMedia(default,null) : StyleMedia
var toolbar(default,null) : BarInfo
Returns the toolbar object, whose visibility can be toggled in the window.
var top(default,null) : DOMWindow

Returns a reference to the topmost window in the window hierarchy. This property is read only.
window.URL

Requires Gecko 2.0

A DOM URL object, which provides the window.URL.createObjectURL() and window.URL.revokeObjectURL() methods.

var window(default,null) : DOMWindow
Returns a reference to the current window.
window0, window1, etc.
Returns a reference to the window object in the frames. See window.frames for more details.
function alert(message : String) : Void
function atob(string : String) : String
function blur() : Void
function btoa(string : String) : String
function cancelAnimationFrame(id : Int) : Void
function cancelRequestAnimationFrame(id : Int) : Void
function captureEvents() : Void
function clearInterval(handle : Int) : Void
function clearTimeout(handle : Int) : Void
function close() : Void
function confirm(message : String) : Bool
function convertPointFromNodeToPage(node : Node, p : Point) : Point
function convertPointFromPageToNode(node : Node, p : Point) : Point
function find(string : String, caseSensitive : Bool, backwards : Bool, wrap : Bool, wholeWord : Bool, searchInFrames : Bool, showDialog : Bool) : Bool
function focus() : Void
function getComputedStyle(element : Element, pseudoElement : String) : CSSStyleDeclaration
function getMatchedCSSRules(element : Element, pseudoElement : String) : CSSRuleList
function getSelection() : DOMSelection
function matchMedia(query : String) : MediaQueryList
function moveBy(x : Float, y : Float) : Void
function moveTo(x : Float, y : Float) : Void
function open(url : String, name : String, ?options : String) : DOMWindow
function openDatabase(name : String, version : String, displayName : String, estimatedSize : Int, ?creationCallback : js.html.sql.DatabaseCallback) : js.html.sql.Database
function postMessage(message : Dynamic, targetOrigin : String, messagePorts : Array<Dynamic>) : Void
Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first, in a secure manner. Throws DOMException.
function print() : Void
function prompt(message : String, defaultValue : String) : String
function releaseEvents() : Void
function requestAnimationFrame(callback_ : RequestAnimationFrameCallback) : Int
function requestFileSystem(type : Int, size : Int, successCallback : js.html.fs.FileSystemCallback, ?errorCallback : js.html.fs.ErrorCallback) : Void
function resizeBy(x : Float, y : Float) : Void
function resizeTo(width : Float, height : Float) : Void
function resolveLocalFileSystemURL(url : String, successCallback : js.html.fs.EntryCallback, ?errorCallback : js.html.fs.ErrorCallback) : Void
function scroll(x : Int, y : Int) : Void
function scrollBy(x : Int, y : Int) : Void
function scrollTo(x : Int, y : Int) : Void
function setInterval(handler : Void -> Void, timeout : Int) : Int
function setTimeout(handler : Void -> Void, timeout : Int) : Int
function showModalDialog(url : String, ?dialogArgs : Dynamic, ?featureArgs : String) : Dynamic
function stop() : Void
static inline var PERSISTENT : Int
static inline var TEMPORARY : Int
Back | Index