class js.html.DOMWindow extends EventTarget
Available on 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.
Class Fields
Instance Fields
var applicationCache:DOMApplicationCache
An nsIDOMOfflineResourceList
object providing access to the offline resources for the window.
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 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.
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.
Returns the horizontal distance of the left border of the user's browser from the left side of the screen.
Returns the vertical distance of the top border of the user's browser from the top side of the screen.
window.URL
Requires Gecko 2.0
window.URL.createObjectURL()
and window.URL.revokeObjectURL()
methods.window
object in the frames. See window.frames
for more details.function find(string:String, caseSensitive:Bool, backwards:Bool, wrap:Bool, wholeWord:Bool, searchInFrames:Bool, showDialog:Bool):Bool
function openDatabase(name:String, version:String, displayName:String, estimatedSize:Int, ?creationCallback:DatabaseCallback):Database
function postMessage(message:Dynamic, targetOrigin:String, messagePorts:Array<Dynamic>):Void
function postMessage(message:Dynamic, targetOrigin:String):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 requestAnimationFrame(callback_:RequestAnimationFrameCallback):Int
function requestAnimationFrame(callback_:RequestAnimationFrameCallback):Int
function requestFileSystem(type:Int, size:Int, successCallback:FileSystemCallback, ?errorCallback:ErrorCallback):Void
function resolveLocalFileSystemURL(url:String, successCallback:EntryCallback, ?errorCallback:ErrorCallback):Void