package js.html
extends EventTarget
Available on js
The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window.
Documentation Window by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
read onlycaches:CacheStorageread onlyclosed:BoolThis property indicates whether the current window is closed or not.
read onlyconsole:ConsoleInstanceReturns a reference to the console object which provides access to the browser's debugging console.
read onlycontent:DynamicReturns a reference to the content element in the current window. Since Firefox 57 (initially Nightly-only), both versions are only available from chrome (privileged) code, and not available to the web anymore.
read onlycrypto:CryptoReturns the browser crypto object.
read onlydevicePixelRatio:FloatReturns the ratio between physical pixels and device independent pixels in the current display.
read onlydocument:HTMLDocumentReturns a reference to the document that the window contains.
read onlyevent:DynamicReturns the current event, which is the event currently being handled by the JavaScript code's context, or undefined if no event is currently being handled. The Event object passed directly to event handlers should be used instead whenever possible.
read onlyframeElement:ElementReturns the element in which the window is embedded, or null if the window is not embedded.
read onlyframes:WindowReturns an array of the subframes in the current window.
fullScreen:BoolThis property indicates whether the window is displayed in full screen or not.
read onlyhistory:HistoryReturns a reference to the history object.
read onlyindexedDB:FactoryinnerHeight:DynamicGets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
innerWidth:DynamicGets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
read onlyisSecureContext:BoolIndicates whether a context is capable of using features that require secure contexts.
read onlylength:IntReturns the number of frames in the window. See also window.frames.
read onlylocalStorage:StorageReturns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
read onlylocation:LocationGets/sets the location, or current URL, of the window object.
read onlylocationbar:BarPropReturns the locationbar object, whose visibility can be toggled in the window.
read onlymenubar:BarPropReturns the menubar object, whose visibility can be toggled in the window.
name:StringGets/sets the name of the window.
read onlynavigator:NavigatorReturns a reference to the navigator object.
onabort:Functiononabsolutedeviceorientation:Functiononafterprint:Functiononanimationcancel:Functiononanimationend:Functiononanimationiteration:Functiononanimationstart:Functiononauxclick:Functiononbeforeprint:Functiononblur:Functiononcanplay:Functiononcanplaythrough:Functiononchange:Functiononclick:Functiononclose:Functiononcontextmenu:Functionondblclick:Functionondevicelight:Functionondevicemotion:Functionondeviceorientation:Functionondeviceproximity:Functionondrag:Functionondragend:Functionondragenter:Functionondragexit:Functionondragleave:Functionondragover:Functionondragstart:Functionondrop:Functionondurationchange:Functiononemptied:Functiononended:Functiononfocus:Functionongotpointercapture:Functiononhashchange:Functiononinput:Functiononinvalid:Functiononkeydown:Functiononkeypress:Functiononkeyup:Functiononlanguagechange:Functiononload:Functiononloadeddata:Functiononloadedmetadata:Functiononloadend:Functiononloadstart:Functiononlostpointercapture:Functiononmessage:Functiononmessageerror:Functiononmousedown:Functiononmouseenter:Functiononmouseleave:Functiononmousemove:Functiononmouseout:Functiononmouseover:Functiononmouseup:Functiononoffline:Functionononline:Functiononorientationchange:Functiononpagehide:Functiononpageshow:Functiononpause:Functiononplay:Functiononplaying:Functiononpointercancel:Functiononpointerdown:Functiononpointerenter:Functiononpointerleave:Functiononpointermove:Functiononpointerout:Functiononpointerover:Functiononpointerup:Functiononpopstate:Functiononprogress:Functiononratechange:Functiononreset:Functiononresize:Functiononscroll:Functiononseeked:Functiononseeking:Functiononselect:Functiononselectstart:Functiononshow:Functiononstalled:Functiononstorage:Functiononsubmit:Functiononsuspend:Functionontimeupdate:Functionontoggle:Functionontouchcancel:Functionontouchend:Functionontouchmove:Functionontouchstart:Functionontransitioncancel:Functionontransitionend:Functionontransitionrun:Functionontransitionstart:Functiononunload:Functiononuserproximity:Functiononvolumechange:Functiononwaiting:Functiononwebkitanimationend:Functiononwebkitanimationiteration:Functiononwebkitanimationstart:Functiononwebkittransitionend:Functiononwheel:Functionopener:DynamicReturns a reference to the window that opened this current window.
read onlyorientation:IntReturns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
read onlyorigin:StringouterHeight:DynamicGets the height of the outside of the browser window.
outerWidth:DynamicGets the width of the outside of the browser window.
read onlypageXOffset:FloatAn alias for window.scrollX.
read onlypageYOffset:Floatwindow.scrollY
read onlyparent:WindowReturns a reference to the parent of the current window or subframe.
read onlyperformance:PerformanceReturns a Performance object, which includes the Performance.timing and Performance.navigation attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples.
read onlypersonalbar:BarPropReturns the personalbar object, whose visibility can be toggled in the window.
read onlyscreen:ScreenReturns a reference to the screen object associated with the window.
screenX:DynamicReturns the horizontal distance of the left border of the user's browser from the left side of the screen.
screenY:DynamicReturns the vertical distance of the top border of the user's browser from the top side of the screen.
read onlyscrollMaxX:IntThe maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
read onlyscrollMaxY:IntThe maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
read onlyscrollX:FloatReturns the number of pixels that the document has already been scrolled horizontally.
read onlyscrollY:FloatReturns the number of pixels that the document has already been scrolled vertically.
read onlyscrollbars:BarPropReturns the scrollbars object, whose visibility can be toggled in the window.
read onlyself:WindowReturns an object reference to the window object itself.
read onlysessionStorage:StorageReturns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
read onlyspeechSynthesis:SpeechSynthesisReturns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
status:StringGets/sets the text in the statusbar at the bottom of the browser.
read onlystatusbar:BarPropReturns the statusbar object, whose visibility can be toggled in the window.
read onlytoolbar:BarPropReturns the toolbar object, whose visibility can be toggled in the window.
read onlytop:WindowReturns a reference to the topmost window in the window hierarchy. This property is read only.
read onlywindow:WindowReturns a reference to the current window.
onbeforeunload:Event ‑> Null<String>onerror:(EitherType<Event, String>, String, Int, Int, Dynamic) ‑> Dynamicalert(message:String):Voidalert():VoidDisplays an alert dialog.
Throws:
null |
DOMError |
|---|
atob(atob:String):StringThrows:
null |
DOMError |
|---|
blur():VoidSets focus away from the window.
Throws:
null |
DOMError |
|---|
btoa(btoa:String):StringThrows:
null |
DOMError |
|---|
cancelAnimationFrame(handle:Int):VoidEnables you to cancel a callback previously scheduled with Window.requestAnimationFrame.
Throws:
null |
DOMError |
|---|
captureEvents():VoidRegisters the window to capture all events of the specified type.
clearInterval(handle:Int = 0):VoidclearTimeout(handle:Int = 0):Voidclose():VoidCloses the current window.
Throws:
null |
DOMError |
|---|
confirm(message:String = ""):BoolDisplays a dialog with a message that the user needs to respond to.
Throws:
null |
DOMError |
|---|
createImageBitmap(aImage:ImageElement, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:VideoElement):Promise<ImageBitmap>createImageBitmap(aImage:CanvasElement):Promise<ImageBitmap>createImageBitmap(aImage:Blob):Promise<ImageBitmap>createImageBitmap(aImage:ImageData):Promise<ImageBitmap>createImageBitmap(aImage:CanvasRenderingContext2D):Promise<ImageBitmap>createImageBitmap(aImage:ImageBitmap):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBufferView):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBuffer):Promise<ImageBitmap>createImageBitmap(aImage:VideoElement, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:CanvasElement, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:Blob, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:ImageData, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:CanvasRenderingContext2D, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:ImageBitmap, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBufferView, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBuffer, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>createImageBitmap(aImage:VideoElement, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:CanvasElement, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:Blob, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:ImageData, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:CanvasRenderingContext2D, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:ImageBitmap, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBufferView, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:ArrayBuffer, aOffset:Int, aLength:Int, aFormat:ImageBitmapFormat, aLayout:Array<ChannelPixelLayout>):Promise<ImageBitmap>createImageBitmap(aImage:ImageElement):Promise<ImageBitmap>createImageBitmap(aImage:ImageElement, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>Throws:
null |
DOMError |
|---|
dump(str:String):VoidWrites a message to the console.
fetch(input:Request, ?init:Null<RequestInit>):Promise<Response>fetch(input:String, ?init:Null<RequestInit>):Promise<Response>find(str:String = "", caseSensitive:Bool = false, backwards:Bool = false, wrapAround:Bool = false, wholeWord:Bool = false, searchInFrames:Bool = false, showDialog:Bool = false):BoolSearches for a given string in a window.
Throws:
null |
DOMError |
|---|
focus():VoidSets focus on the current window.
Throws:
null |
DOMError |
|---|
getComputedStyle(elt:Element, pseudoElt:String = ""):CSSStyleDeclarationGets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
Throws:
null |
DOMError |
|---|
getDefaultComputedStyle(elt:Element, pseudoElt:String = ""):CSSStyleDeclarationGets default computed style for the specified element, ignoring author stylesheets.
Throws:
null |
DOMError |
|---|
getSelection():SelectionReturns the selection object representing the selected item(s).
Throws:
null |
DOMError |
|---|
matchMedia(query:String):MediaQueryListReturns a MediaQueryList object representing the specified media query string.
Throws:
null |
DOMError |
|---|
moveBy(x:Int, y:Int):VoidMoves the current window by a specified amount.
Throws:
null |
DOMError |
|---|
moveTo(x:Int, y:Int):VoidMoves the window to the specified coordinates.
Throws:
null |
DOMError |
|---|
open(url:String = "", target:String = "", features:String = ""):WindowOpens a new window.
Throws:
null |
DOMError |
|---|
postMessage(message:Dynamic, targetOrigin:String, ?transfer:Array<Dynamic>):VoidProvides 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.
Throws:
null |
DOMError |
|---|
print():VoidOpens the Print Dialog to print the current document.
Throws:
null |
DOMError |
|---|
prompt(message:String = "", default_:String = ""):StringReturns the text entered by the user in a prompt dialog.
Throws:
null |
DOMError |
|---|
releaseEvents():VoidReleases the window from trapping events of a specific type.
requestAnimationFrame(callback:Float ‑> Void):IntTells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
Throws:
null |
DOMError |
|---|
resizeBy(x:Int, y:Int):VoidResizes the current window by a certain amount.
Throws:
null |
DOMError |
|---|
resizeTo(x:Int, y:Int):VoidDynamically resizes window.
Throws:
null |
DOMError |
|---|
scroll(?options:Null<ScrollToOptions>):Voidscroll(x:Float, y:Float):VoidScrolls the window to a particular place in the document.
scrollBy(?options:Null<ScrollToOptions>):VoidscrollBy(x:Float, y:Float):VoidScrolls the document in the window by the given amount.
scrollByLines(numLines:Int, ?options:Null<ScrollOptions>):VoidScrolls the document by the given number of lines.
scrollByPages(numPages:Int, ?options:Null<ScrollOptions>):VoidScrolls the current document by the specified number of pages.
scrollTo(?options:Null<ScrollToOptions>):VoidscrollTo(x:Float, y:Float):VoidScrolls to a particular set of coordinates in the document.
setInterval(handler:String, timeout:Float = 0, unused:Rest<Dynamic>):IntsetInterval(handler:Function, timeout:Float = 0, arguments:Rest<Dynamic>):IntThrows:
null |
DOMError |
|---|
setResizable(resizable:Bool):VoidToggles a user's ability to resize a window.
setTimeout(handler:String, timeout:Float = 0, unused:Rest<Dynamic>):IntsetTimeout(handler:Function, timeout:Float = 0, arguments:Rest<Dynamic>):IntThrows:
null |
DOMError |
|---|
sizeToContent():VoidSizes the window according to its content.
Throws:
null |
DOMError |
|---|
stop():VoidThis method stops window loading.
Throws:
null |
DOMError |
|---|
updateCommands(action:String, ?sel:Selection, reason:Int = 0):VoidUpdates the state of commands of the current chrome window (UI).
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Window.html