class js.html.DOMWindow extends EventTarget
Available on jsThis 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.
Class Fields
var PERSISTENT:Int
Instance Fields
var applicationCache:DOMApplicationCache
An nsIDOMOfflineResourceList
object providing access to the offline resources for the window.
var closed:Bool
var defaultstatus:String
var frameElement:Element
Returns the element in which the window is embedded, or null if the window is not embedded.
var innerHeight:Int
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
var innerWidth:Int
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
var localStorage: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 locationbar:BarInfo
Returns the locationbar object, whose visibility can be toggled in the window.
var ondrag:EventListener
var ondrop:EventListener
var onended:EventListener
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 onpause:EventListener
var onplay: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 personalbar:BarInfo
Returns the personalbar object, whose visibility can be toggled in the window.
var screenLeft:Int
var screenX:Int
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
var screenY:Int
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
var scrollX:Int
Returns the number of pixels that the document has already been scrolled horizontally.
var sessionStorage:Storage
A storage object for storing data within a single page session. Getter throws DOMException.
var styleMedia:StyleMedia
var top:DOMWindow
window.URLRequires Gecko 2.0
window.URL.createObjectURL()
and window.URL.revokeObjectURL()
methods.var window:DOMWindow
window object in the frames. See window.frames
for more details.function cancelAnimationFrame(id:Int):Void
function cancelRequestAnimationFrame(id:Int):Void
function captureEvents():Void
function clearInterval(handle:Int):Void
function clearTimeout(handle:Int):Void
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 getComputedStyle(element:Element, pseudoElement:String):CSSStyleDeclaration
function getMatchedCSSRules(element:Element, pseudoElement:String):CSSRuleList
function getSelection():DOMSelection
function matchMedia(query:String):MediaQueryList
function openDatabase(name:String, version:String, displayName:String, estimatedSize:Int, creationCallback:DatabaseCallback):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.