content: DynamicWindow
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.
Instance Members
window: WindowReturns a reference to the current window.
self: WindowReturns an object reference to the window object itself.
document: HTMLDocumentReturns a reference to the document that the window contains.
name: StringGets/sets the name of the window.
location: LocationGets/sets the location, or current URL, of the window object.
history: HistoryReturns a reference to the history object.
locationbar: BarPropReturns the locationbar object, whose visibility can be toggled in the window.
Returns the menubar object, whose visibility can be toggled in the window.
personalbar: BarPropReturns the personalbar object, whose visibility can be toggled in the window.
scrollbars: BarPropReturns the scrollbars object, whose visibility can be toggled in the window.
statusbar: BarPropReturns the statusbar object, whose visibility can be toggled in the window.
toolbar: BarPropReturns the toolbar object, whose visibility can be toggled in the window.
status: StringGets/sets the text in the statusbar at the bottom of the browser.
closed: BoolThis property indicates whether the current window is closed or not.
event: 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.
frames: WindowReturns an array of the subframes in the current window.
length: IntReturns the number of frames in the window. See also window.frames.
top: WindowReturns a reference to the topmost window in the window hierarchy. This property is read only.
opener: DynamicReturns a reference to the window that opened this current window.
parent: WindowReturns a reference to the parent of the current window or subframe.
frameElement: ElementReturns the element in which the window is embedded, or null if the window is not embedded.
Returns a reference to the navigator object.
console: ConsoleInstanceReturns a reference to the console object which provides access to the browser's debugging console.
screen: ScreenReturns a reference to the screen object associated with the window.
innerWidth: DynamicGets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
innerHeight: DynamicGets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
scrollX: FloatReturns the number of pixels that the document has already been scrolled horizontally.
pageXOffset: FloatAn alias for window.scrollX.
scrollY: FloatReturns the number of pixels that the document has already been scrolled vertically.
pageYOffset: FloatAn alias for window.scrollY
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.
outerWidth: DynamicGets the width of the outside of the browser window.
outerHeight: DynamicGets the height of the outside of the browser window.
performance: 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.
devicePixelRatio: FloatReturns the ratio between physical pixels and device independent pixels in the current display.
scrollMaxX: IntThe maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
scrollMaxY: IntThe maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
fullScreen: BoolThis property indicates whether the window is displayed in full screen or not.
ondevicemotion: haxe.Functionondeviceorientation: haxe.Functiononabsolutedeviceorientation: haxe.Functionondeviceproximity: haxe.Functiononuserproximity: haxe.Functionondevicelight: haxe.FunctionReturns 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.
orientation: IntReturns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
onorientationchange: haxe.Functioncrypto: CryptoReturns the browser crypto object.
onabort: haxe.Functiononblur: haxe.Functiononfocus: haxe.Functiononauxclick: haxe.Functiononcanplay: haxe.Functiononcanplaythrough: haxe.Functiononchange: haxe.Functiononclick: haxe.Functiononclose: haxe.Functionondblclick: haxe.Functionondrag: haxe.Functionondragend: haxe.Functionondragenter: haxe.Functionondragexit: haxe.Functionondragleave: haxe.Functionondragover: haxe.Functionondragstart: haxe.Functionondrop: haxe.Functionondurationchange: haxe.Functiononemptied: haxe.Functiononended: haxe.Functiononinput: haxe.Functiononinvalid: haxe.Functiononkeydown: haxe.Functiononkeypress: haxe.Functiononkeyup: haxe.Functiononload: haxe.Functiononloadeddata: haxe.Functiononloadedmetadata: haxe.Functiononloadend: haxe.Functiononloadstart: haxe.Functiononmousedown: haxe.Functiononmouseenter: haxe.Functiononmouseleave: haxe.Functiononmousemove: haxe.Functiononmouseout: haxe.Functiononmouseover: haxe.Functiononmouseup: haxe.Functiononwheel: haxe.Functiononpause: haxe.Functiononplay: haxe.Functiononplaying: haxe.Functiononprogress: haxe.Functiononratechange: haxe.Functiononreset: haxe.Functiononresize: haxe.Functiononscroll: haxe.Functiononseeked: haxe.Functiononseeking: haxe.Functiononselect: haxe.Functiononshow: haxe.Functiononstalled: haxe.Functiononsubmit: haxe.Functiononsuspend: haxe.Functionontimeupdate: haxe.Functiononvolumechange: haxe.Functiononwaiting: haxe.Functiononselectstart: haxe.Functionontoggle: haxe.Functiononpointercancel: haxe.Functiononpointerdown: haxe.Functiononpointerup: haxe.Functiononpointermove: haxe.Functiononpointerout: haxe.Functiononpointerover: haxe.Functiononpointerenter: haxe.Functiononpointerleave: haxe.Functionongotpointercapture: haxe.Functiononlostpointercapture: haxe.Functiononanimationcancel: haxe.Functiononanimationend: haxe.Functiononanimationiteration: haxe.Functiononanimationstart: haxe.Functionontransitioncancel: haxe.Functionontransitionend: haxe.Functionontransitionrun: haxe.Functionontransitionstart: haxe.Functiononwebkitanimationend: haxe.Functiononwebkitanimationiteration: haxe.Functiononwebkitanimationstart: haxe.Functiononwebkittransitionend: haxe.FunctionspeechSynthesis: SpeechSynthesisReturns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
ontouchstart: haxe.Functionontouchend: haxe.Functionontouchmove: haxe.Functionontouchcancel: haxe.Functiononafterprint: haxe.Functiononbeforeprint: haxe.Functiononhashchange: haxe.Functiononlanguagechange: haxe.Functiononmessage: haxe.Functiononmessageerror: haxe.Functiononoffline: haxe.Functionononline: haxe.Functiononpagehide: haxe.Functiononpageshow: haxe.Functiononpopstate: haxe.Functiononstorage: haxe.Functiononunload: haxe.FunctionlocalStorage: StorageReturns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
origin: StringisSecureContext: BoolIndicates whether a context is capable of using features that require secure contexts.
indexedDB: js.html.idb.Factorycaches: CacheStoragesessionStorage: StorageReturns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
| Name | Type |
|---|---|
| `` | haxe.extern.EitherType<Event, String> |
| `` | String |
| `` | Int |
| `` | Int |
| `` | Dynamic |
| Returns |
|---|
| Dynamic |
| Returns |
|---|
| Null<String> |
close(): VoidCloses the current window.
stop(): VoidThis method stops window loading.
focus(): VoidSets focus on the current window.
blur(): VoidSets focus away from the window.
Opens a new window.
| Name | Type | Default |
|---|---|---|
url |
String | "" |
target |
String | "" |
features |
String | "" |
| Returns |
|---|
| Window |
Displays an alert dialog.
| Name | Type |
|---|---|
message |
String |
Displays a dialog with a message that the user needs to respond to.
| Name | Type | Default |
|---|---|---|
message |
String | "" |
| Returns |
|---|
| Bool |
Returns the text entered by the user in a prompt dialog.
| Name | Type | Default |
|---|---|---|
message |
String | "" |
default_ |
String | "" |
| Returns |
|---|
| String |
print(): VoidOpens the Print Dialog to print the current document.
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.
| Name | Type | Default |
|---|---|---|
message |
Dynamic | |
targetOrigin |
String | |
transfer |
Array<Dynamic> | (optional) |
captureEvents(): VoidRegisters the window to capture all events of the specified type.
releaseEvents(): VoidReleases the window from trapping events of a specific type.
getSelection(): SelectionReturns the selection object representing the selected item(s).
| Returns |
|---|
| Selection |
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.
| Name | Type | Default |
|---|---|---|
elt |
Element | |
pseudoElt |
String | "" |
| Returns |
|---|
| CSSStyleDeclaration |
matchMedia(query: String): MediaQueryListReturns a MediaQueryList object representing the specified media query string.
| Name | Type |
|---|---|
query |
String |
| Returns |
|---|
| MediaQueryList |
Moves the window to the specified coordinates.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
Moves the current window by a specified amount.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
Dynamically resizes window.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
Resizes the current window by a certain amount.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
scroll(?options: Null<ScrollToOptions>): VoidScrolls the window to a particular place in the document.
| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
scrollTo(?options: Null<ScrollToOptions>): VoidScrolls to a particular set of coordinates in the document.
| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
scrollBy(?options: Null<ScrollToOptions>): VoidScrolls the document in the window by the given amount.
| Name | Type | Default |
|---|---|---|
options |
Null<ScrollToOptions> | (optional) |
requestAnimationFrame(callback: Function): IntTells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
| Name | Type |
|---|---|
callback |
Function |
| Returns |
|---|
| Int |
Enables you to cancel a callback previously scheduled with Window.requestAnimationFrame.
| Name | Type |
|---|---|
handle |
Int |
getDefaultComputedStyle(elt: Element, ?pseudoElt: String = ""): CSSStyleDeclarationGets default computed style for the specified element, ignoring author stylesheets.
| Name | Type | Default |
|---|---|---|
elt |
Element | |
pseudoElt |
String | "" |
| Returns |
|---|
| CSSStyleDeclaration |
scrollByLines(numLines: Int, ?options: Null<ScrollOptions>): VoidScrolls the document by the given number of lines.
| Name | Type | Default |
|---|---|---|
numLines |
Int | |
options |
Null<ScrollOptions> | (optional) |
scrollByPages(numPages: Int, ?options: Null<ScrollOptions>): VoidScrolls the current document by the specified number of pages.
| Name | Type | Default |
|---|---|---|
numPages |
Int | |
options |
Null<ScrollOptions> | (optional) |
sizeToContent(): VoidSizes the window according to its content.
Updates the state of commands of the current chrome window (UI).
| Name | Type | Default |
|---|---|---|
action |
String | |
sel |
Selection | (optional) |
reason |
Int | 0 |
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.
| Name | Type | Default |
|---|---|---|
str |
String | "" |
caseSensitive |
Bool | false |
backwards |
Bool | false |
wrapAround |
Bool | false |
wholeWord |
Bool | false |
searchInFrames |
Bool | false |
showDialog |
Bool | false |
| Returns |
|---|
| Bool |
Writes a message to the console.
| Name | Type |
|---|---|
str |
String |
Creates a deep clone of a given value using the structured clone algorithm.
| Name | Type | Default |
|---|---|---|
value |
structuredClone.T | |
options |
AnonStruct | (optional) |
| Returns |
|---|
| structuredClone.T |
Toggles a user's ability to resize a window.
| Name | Type |
|---|---|
resizable |
Bool |
| Name | Type |
|---|---|
btoa |
String |
| Returns |
|---|
| String |
| Name | Type |
|---|---|
atob |
String |
| Returns |
|---|
| String |
setTimeout(handler: String, ?timeout: Float = 0, unused: haxe.extern.Rest): Int| Name | Type | Default |
|---|---|---|
handler |
String | |
timeout |
Float | 0 |
unused |
haxe.extern.Rest |
| Returns |
|---|
| Int |
| Name | Type | Default |
|---|---|---|
handle |
Int | 0 |
setInterval(handler: String, ?timeout: Float = 0, unused: haxe.extern.Rest): Int| Name | Type | Default |
|---|---|---|
handler |
String | |
timeout |
Float | 0 |
unused |
haxe.extern.Rest |
| Returns |
|---|
| Int |
| Name | Type | Default |
|---|---|---|
handle |
Int | 0 |
createImageBitmap(aImage: ImageElement, aOffset: Int, aLength: Int, aFormat: ImageBitmapFormat, aLayout: Array<ChannelPixelLayout>): js.lib.Promise<ImageBitmap>| Name | Type |
|---|---|
aImage |
ImageElement |
aOffset |
Int |
aLength |
Int |
aFormat |
ImageBitmapFormat |
aLayout |
Array<ChannelPixelLayout> |
| Returns |
|---|
| js.lib.Promise<ImageBitmap> |
fetch(input: Request, ?init: Null<RequestInit>): js.lib.Promise<Response>| Name | Type | Default |
|---|---|---|
input |
Request | |
init |
Null<RequestInit> | (optional) |
| Returns |
|---|
| js.lib.Promise<Response> |