Window interface

A window containing a DOM document; the document property points to the DOM document loaded in that window.

Extends

EventTarget,AnimationFrameProvider,GlobalEventHandlers,WindowEventHandlers,WindowLocalStorage,WindowOrWorkerGlobalScope,WindowSessionStorage

Properties

clientInformation
closed

Returns true if the window has been closed, false otherwise.

customElements

Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element.

devicePixelRatio
document
event
external
frameElement
frames
history
innerHeight
innerWidth
length
location
locationbar

Returns true if the location bar is visible; otherwise, returns false.

menubar

Returns true if the menu bar is visible; otherwise, returns false.

msCrypto
name
navigator
ondevicemotion

Available only in secure contexts.

ondeviceorientation

Available only in secure contexts.

onorientationchange
opener
orientation
outerHeight
outerWidth
pageXOffset
pageYOffset
parent

Refers to either the parent WindowProxy, or itself.

It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.

personalbar

Returns true if the personal bar is visible; otherwise, returns false.

powerbi
powerBISDKGlobalServiceInstanceName
screen
screenLeft
screenTop
screenX
screenY
scrollbars

Returns true if the scrollbars are visible; otherwise, returns false.

scrollX
scrollY
self
speechSynthesis
status
statusbar

Returns true if the status bar is visible; otherwise, returns false.

toolbar

Returns true if the toolbar is visible; otherwise, returns false.

top
visualViewport
window

Inherited Properties

caches

Available only in secure contexts.

crossOriginIsolated
crypto
indexedDB
isSecureContext
localStorage
onabort

Fires when the user aborts the download.

onafterprint
onanimationcancel
onanimationend
onanimationiteration
onanimationstart
onauxclick
onbeforeinput
onbeforeprint
onbeforeunload
onblur

Fires when the object loses the input focus.

oncancel
oncanplay

Occurs when playback is possible, but would require further buffering.

oncanplaythrough
onchange

Fires when the contents of the object or selection have changed.

onclick

Fires when the user clicks the left mouse button on the object

onclose
oncontextmenu

Fires when the user clicks the right mouse button in the client area, opening the context menu.

oncuechange
ondblclick

Fires when the user double-clicks the object.

ondrag

Fires on the source object continuously during a drag operation.

ondragend

Fires on the source object when the user releases the mouse at the close of a drag operation.

ondragenter

Fires on the target element when the user drags the object to a valid drop target.

ondragleave

Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

ondragover

Fires on the target element continuously while the user drags the object over a valid drop target.

ondragstart

Fires on the source object when the user starts to drag a text selection or selected object.

ondrop
ondurationchange

Occurs when the duration attribute is updated.

onemptied

Occurs when the media element is reset to its initial state.

onended

Occurs when the end of playback is reached.

onerror

Fires when an error occurs during object loading.

onfocus

Fires when the object receives focus.

onformdata
ongamepadconnected
ongamepaddisconnected
ongotpointercapture
onhashchange
oninput
oninvalid
onkeydown

Fires when the user presses a key.

onkeypress

Fires when the user presses an alphanumeric key.

onkeyup

Fires when the user releases a key.

onlanguagechange
onload

Fires immediately after the browser loads the object.

onloadeddata

Occurs when media data is loaded at the current playback position.

onloadedmetadata

Occurs when the duration and dimensions of the media have been determined.

onloadstart

Occurs when Internet Explorer begins looking for media data.

onlostpointercapture
onmessage
onmessageerror
onmousedown

Fires when the user clicks the object with either mouse button.

onmouseenter
onmouseleave
onmousemove

Fires when the user moves the mouse over the object.

onmouseout

Fires when the user moves the mouse pointer outside the boundaries of the object.

onmouseover

Fires when the user moves the mouse pointer into the object.

onmouseup

Fires when the user releases a mouse button while the mouse is over the object.

onoffline
ononline
onpagehide
onpageshow
onpause

Occurs when playback is paused.

onplay

Occurs when the play method is requested.

onplaying

Occurs when the audio or video has started playing.

onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onpopstate
onprogress

Occurs to indicate progress while downloading media data.

onratechange

Occurs when the playback rate is increased or decreased.

onrejectionhandled
onreset

Fires when the user resets a form.

onresize
onscroll

Fires when the user repositions the scroll box in the scroll bar on the object.

onsecuritypolicyviolation
onseeked

Occurs when the seek operation ends.

onseeking

Occurs when the current playback position is moved.

onselect

Fires when the current selection changes.

onselectionchange
onselectstart
onslotchange
onstalled

Occurs when the download has stopped.

onstorage
onsubmit
onsuspend

Occurs if the load operation has been intentionally halted.

ontimeupdate

Occurs to indicate the current playback position.

ontoggle
ontouchcancel
ontouchend
ontouchmove
ontouchstart
ontransitioncancel
ontransitionend
ontransitionrun
ontransitionstart
onunhandledrejection
onunload
onvolumechange

Occurs when the volume is changed, or playback is muted or unmuted.

onwaiting

Occurs when playback stops because the next frame of a video resource is not available.

onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationstart
onwebkittransitionend
onwheel
origin
performance
sessionStorage

Methods

addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)
addEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | AddEventListenerOptions)
alert(any)
blur()
cancelIdleCallback(number)
captureEvents()
close()

Closes the window.

confirm(string)
focus()

Moves the focus to the window's browsing context, if any.

getComputedStyle(Element, null | string)
getSelection()
matchMedia(string)
moveBy(number, number)
moveTo(number, number)
open(string | URL, string, string)
postMessage(any, string, Transferable[])

Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.

Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.

A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.

If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".

Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.

postMessage(any, WindowPostMessageOptions)
print()
prompt(string, string)
releaseEvents()
removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)
removeEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | EventListenerOptions)
requestIdleCallback(IdleRequestCallback, IdleRequestOptions)
resizeBy(number, number)
resizeTo(number, number)
scroll(number, number)
scroll(ScrollToOptions)
scrollBy(number, number)
scrollBy(ScrollToOptions)
scrollTo(number, number)
scrollTo(ScrollToOptions)
stop()

Cancels the document load.

Inherited Methods

atob(string)
btoa(string)
cancelAnimationFrame(number)
clearInterval(undefined | number)
clearTimeout(undefined | number)
createImageBitmap(ImageBitmapSource, ImageBitmapOptions)
createImageBitmap(ImageBitmapSource, number, number, number, number, ImageBitmapOptions)
dispatchEvent(Event)

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

fetch(URL | RequestInfo, RequestInit)
queueMicrotask(VoidFunction)
reportError(any)
requestAnimationFrame(FrameRequestCallback)
setInterval(TimerHandler, number, any[])
setTimeout(TimerHandler, number, any[])
structuredClone(any, StructuredSerializeOptions)

Property Details

clientInformation

Warning

This API is now deprecated.

This is a legacy alias of navigator.

clientInformation: Navigator

Property Value

Navigator

closed

Returns true if the window has been closed, false otherwise.

closed: boolean

Property Value

boolean

customElements

Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element.

customElements: CustomElementRegistry

Property Value

CustomElementRegistry

devicePixelRatio

devicePixelRatio: number

Property Value

number

document

document: Document

Property Value

Document

event

Warning

This API is now deprecated.

event: undefined | Event

Property Value

undefined | Event

external

Warning

This API is now deprecated.

external: External

Property Value

External

frameElement

frameElement: null | Element

Property Value

null | Element

frames

frames: Window

Property Value

Window

history

history: History

Property Value

History

innerHeight

innerHeight: number

Property Value

number

innerWidth

innerWidth: number

Property Value

number

length

length: number

Property Value

number

location

Location location

Property Value

Location

locationbar

Returns true if the location bar is visible; otherwise, returns false.

locationbar: BarProp

Property Value

BarProp

menubar

Returns true if the menu bar is visible; otherwise, returns false.

menubar: BarProp

Property Value

BarProp

msCrypto

msCrypto: Crypto

Property Value

Crypto

name

name: string

Property Value

string

navigator

navigator: Navigator

Property Value

Navigator

ondevicemotion

Available only in secure contexts.

ondevicemotion: null | (this: Window, ev: DeviceMotionEvent) => any

Property Value

null | (this: Window, ev: DeviceMotionEvent) => any

ondeviceorientation

Available only in secure contexts.

ondeviceorientation: null | (this: Window, ev: DeviceOrientationEvent) => any

Property Value

null | (this: Window, ev: DeviceOrientationEvent) => any

onorientationchange

Warning

This API is now deprecated.

onorientationchange: null | (this: Window, ev: Event) => any

Property Value

null | (this: Window, ev: Event) => any

opener

opener: any

Property Value

any

orientation

Warning

This API is now deprecated.

orientation: number

Property Value

number

outerHeight

outerHeight: number

Property Value

number

outerWidth

outerWidth: number

Property Value

number

pageXOffset

Warning

This API is now deprecated.

This is a legacy alias of scrollX.

pageXOffset: number

Property Value

number

pageYOffset

Warning

This API is now deprecated.

This is a legacy alias of scrollY.

pageYOffset: number

Property Value

number

parent

Refers to either the parent WindowProxy, or itself.

It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.

parent: Window

Property Value

Window

personalbar

Returns true if the personal bar is visible; otherwise, returns false.

personalbar: BarProp

Property Value

BarProp

powerbi

powerbi: Service

Property Value

powerBISDKGlobalServiceInstanceName

powerBISDKGlobalServiceInstanceName?: string

Property Value

string

screen

screen: Screen

Property Value

Screen

screenLeft

screenLeft: number

Property Value

number

screenTop

screenTop: number

Property Value

number

screenX

screenX: number

Property Value

number

screenY

screenY: number

Property Value

number

scrollbars

Returns true if the scrollbars are visible; otherwise, returns false.

scrollbars: BarProp

Property Value

BarProp

scrollX

scrollX: number

Property Value

number

scrollY

scrollY: number

Property Value

number

self

self: Window & typeof globalThis

Property Value

Window & typeof globalThis

speechSynthesis

speechSynthesis: SpeechSynthesis

Property Value

SpeechSynthesis

status

Warning

This API is now deprecated.

status: string

Property Value

string

statusbar

Returns true if the status bar is visible; otherwise, returns false.

statusbar: BarProp

Property Value

BarProp

toolbar

Returns true if the toolbar is visible; otherwise, returns false.

toolbar: BarProp

Property Value

BarProp

top

top: null | Window

Property Value

null | Window

visualViewport

visualViewport: null | VisualViewport

Property Value

null | VisualViewport

window

window: Window & typeof globalThis

Property Value

Window & typeof globalThis

Inherited Property Details

caches

Available only in secure contexts.

caches: CacheStorage

Property Value

CacheStorage

Inherited From WindowOrWorkerGlobalScope.caches

crossOriginIsolated

crossOriginIsolated: boolean

Property Value

boolean

Inherited From WindowOrWorkerGlobalScope.crossOriginIsolated

crypto

crypto: Crypto

Property Value

Crypto

Inherited From WindowOrWorkerGlobalScope.crypto

indexedDB

indexedDB: IDBFactory

Property Value

IDBFactory

Inherited From WindowOrWorkerGlobalScope.indexedDB

isSecureContext

isSecureContext: boolean

Property Value

boolean

Inherited From WindowOrWorkerGlobalScope.isSecureContext

localStorage

localStorage: Storage

Property Value

Storage

Inherited From WindowLocalStorage.localStorage

onabort

Fires when the user aborts the download.

onabort: null | (this: GlobalEventHandlers, ev: UIEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: UIEvent) => any

Inherited From GlobalEventHandlers.onabort

onafterprint

onafterprint: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.onafterprint

onanimationcancel

onanimationcancel: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Inherited From GlobalEventHandlers.onanimationcancel

onanimationend

onanimationend: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Inherited From GlobalEventHandlers.onanimationend

onanimationiteration

onanimationiteration: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Inherited From GlobalEventHandlers.onanimationiteration

onanimationstart

onanimationstart: null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: AnimationEvent) => any

Inherited From GlobalEventHandlers.onanimationstart

onauxclick

onauxclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onauxclick

onbeforeinput

onbeforeinput: null | (this: GlobalEventHandlers, ev: InputEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: InputEvent) => any

Inherited From GlobalEventHandlers.onbeforeinput

onbeforeprint

onbeforeprint: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.onbeforeprint

onbeforeunload

onbeforeunload: null | (this: WindowEventHandlers, ev: BeforeUnloadEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: BeforeUnloadEvent) => any

Inherited From WindowEventHandlers.onbeforeunload

onblur

Fires when the object loses the input focus.

onblur: null | (this: GlobalEventHandlers, ev: FocusEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: FocusEvent) => any

Inherited From GlobalEventHandlers.onblur

oncancel

oncancel: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oncancel

oncanplay

Occurs when playback is possible, but would require further buffering.

oncanplay: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oncanplay

oncanplaythrough

oncanplaythrough: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oncanplaythrough

onchange

Fires when the contents of the object or selection have changed.

onchange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onchange

onclick

Fires when the user clicks the left mouse button on the object

onclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onclick

onclose

onclose: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onclose

oncontextmenu

Fires when the user clicks the right mouse button in the client area, opening the context menu.

oncontextmenu: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.oncontextmenu

oncuechange

oncuechange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oncuechange

ondblclick

Fires when the user double-clicks the object.

ondblclick: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.ondblclick

ondrag

Fires on the source object continuously during a drag operation.

ondrag: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondrag

ondragend

Fires on the source object when the user releases the mouse at the close of a drag operation.

ondragend: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondragend

ondragenter

Fires on the target element when the user drags the object to a valid drop target.

ondragenter: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondragenter

ondragleave

Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

ondragleave: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondragleave

ondragover

Fires on the target element continuously while the user drags the object over a valid drop target.

ondragover: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondragover

ondragstart

Fires on the source object when the user starts to drag a text selection or selected object.

ondragstart: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondragstart

ondrop

ondrop: null | (this: GlobalEventHandlers, ev: DragEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: DragEvent) => any

Inherited From GlobalEventHandlers.ondrop

ondurationchange

Occurs when the duration attribute is updated.

ondurationchange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.ondurationchange

onemptied

Occurs when the media element is reset to its initial state.

onemptied: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onemptied

onended

Occurs when the end of playback is reached.

onended: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onended

onerror

Fires when an error occurs during object loading.

onerror: OnErrorEventHandler

Property Value

OnErrorEventHandler

Inherited From GlobalEventHandlers.onerror

onfocus

Fires when the object receives focus.

onfocus: null | (this: GlobalEventHandlers, ev: FocusEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: FocusEvent) => any

Inherited From GlobalEventHandlers.onfocus

onformdata

onformdata: null | (this: GlobalEventHandlers, ev: FormDataEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: FormDataEvent) => any

Inherited From GlobalEventHandlers.onformdata

ongamepadconnected

ongamepadconnected: null | (this: WindowEventHandlers, ev: GamepadEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: GamepadEvent) => any

Inherited From WindowEventHandlers.ongamepadconnected

ongamepaddisconnected

ongamepaddisconnected: null | (this: WindowEventHandlers, ev: GamepadEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: GamepadEvent) => any

Inherited From WindowEventHandlers.ongamepaddisconnected

ongotpointercapture

ongotpointercapture: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.ongotpointercapture

onhashchange

onhashchange: null | (this: WindowEventHandlers, ev: HashChangeEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: HashChangeEvent) => any

Inherited From WindowEventHandlers.onhashchange

oninput

oninput: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oninput

oninvalid

oninvalid: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.oninvalid

onkeydown

Fires when the user presses a key.

onkeydown: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Inherited From GlobalEventHandlers.onkeydown

onkeypress

Warning

This API is now deprecated.

Fires when the user presses an alphanumeric key.

onkeypress: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Inherited From GlobalEventHandlers.onkeypress

onkeyup

Fires when the user releases a key.

onkeyup: null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: KeyboardEvent) => any

Inherited From GlobalEventHandlers.onkeyup

onlanguagechange

onlanguagechange: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.onlanguagechange

onload

Fires immediately after the browser loads the object.

onload: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onload

onloadeddata

Occurs when media data is loaded at the current playback position.

onloadeddata: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onloadeddata

onloadedmetadata

Occurs when the duration and dimensions of the media have been determined.

onloadedmetadata: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onloadedmetadata

onloadstart

Occurs when Internet Explorer begins looking for media data.

onloadstart: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onloadstart

onlostpointercapture

onlostpointercapture: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onlostpointercapture

onmessage

onmessage: null | (this: WindowEventHandlers, ev: MessageEvent<any>) => any

Property Value

null | (this: WindowEventHandlers, ev: MessageEvent<any>) => any

Inherited From WindowEventHandlers.onmessage

onmessageerror

onmessageerror: null | (this: WindowEventHandlers, ev: MessageEvent<any>) => any

Property Value

null | (this: WindowEventHandlers, ev: MessageEvent<any>) => any

Inherited From WindowEventHandlers.onmessageerror

onmousedown

Fires when the user clicks the object with either mouse button.

onmousedown: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmousedown

onmouseenter

onmouseenter: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmouseenter

onmouseleave

onmouseleave: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmouseleave

onmousemove

Fires when the user moves the mouse over the object.

onmousemove: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmousemove

onmouseout

Fires when the user moves the mouse pointer outside the boundaries of the object.

onmouseout: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmouseout

onmouseover

Fires when the user moves the mouse pointer into the object.

onmouseover: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmouseover

onmouseup

Fires when the user releases a mouse button while the mouse is over the object.

onmouseup: null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: MouseEvent) => any

Inherited From GlobalEventHandlers.onmouseup

onoffline

onoffline: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.onoffline

ononline

ononline: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.ononline

onpagehide

onpagehide: null | (this: WindowEventHandlers, ev: PageTransitionEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: PageTransitionEvent) => any

Inherited From WindowEventHandlers.onpagehide

onpageshow

onpageshow: null | (this: WindowEventHandlers, ev: PageTransitionEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: PageTransitionEvent) => any

Inherited From WindowEventHandlers.onpageshow

onpause

Occurs when playback is paused.

onpause: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onpause

onplay

Occurs when the play method is requested.

onplay: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onplay

onplaying

Occurs when the audio or video has started playing.

onplaying: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onplaying

onpointercancel

onpointercancel: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointercancel

onpointerdown

onpointerdown: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerdown

onpointerenter

onpointerenter: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerenter

onpointerleave

onpointerleave: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerleave

onpointermove

onpointermove: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointermove

onpointerout

onpointerout: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerout

onpointerover

onpointerover: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerover

onpointerup

onpointerup: null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: PointerEvent) => any

Inherited From GlobalEventHandlers.onpointerup

onpopstate

onpopstate: null | (this: WindowEventHandlers, ev: PopStateEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: PopStateEvent) => any

Inherited From WindowEventHandlers.onpopstate

onprogress

Occurs to indicate progress while downloading media data.

onprogress: null | (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any

Property Value

null | (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any

Inherited From GlobalEventHandlers.onprogress

onratechange

Occurs when the playback rate is increased or decreased.

onratechange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onratechange

onrejectionhandled

onrejectionhandled: null | (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any

Inherited From WindowEventHandlers.onrejectionhandled

onreset

Fires when the user resets a form.

onreset: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onreset

onresize

onresize: null | (this: GlobalEventHandlers, ev: UIEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: UIEvent) => any

Inherited From GlobalEventHandlers.onresize

onscroll

Fires when the user repositions the scroll box in the scroll bar on the object.

onscroll: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onscroll

onsecuritypolicyviolation

onsecuritypolicyviolation: null | (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any

Inherited From GlobalEventHandlers.onsecuritypolicyviolation

onseeked

Occurs when the seek operation ends.

onseeked: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onseeked

onseeking

Occurs when the current playback position is moved.

onseeking: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onseeking

onselect

Fires when the current selection changes.

onselect: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onselect

onselectionchange

onselectionchange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onselectionchange

onselectstart

onselectstart: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onselectstart

onslotchange

onslotchange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onslotchange

onstalled

Occurs when the download has stopped.

onstalled: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onstalled

onstorage

onstorage: null | (this: WindowEventHandlers, ev: StorageEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: StorageEvent) => any

Inherited From WindowEventHandlers.onstorage

onsubmit

onsubmit: null | (this: GlobalEventHandlers, ev: SubmitEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: SubmitEvent) => any

Inherited From GlobalEventHandlers.onsubmit

onsuspend

Occurs if the load operation has been intentionally halted.

onsuspend: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onsuspend

ontimeupdate

Occurs to indicate the current playback position.

ontimeupdate: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.ontimeupdate

ontoggle

ontoggle: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.ontoggle

ontouchcancel

ontouchcancel?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Inherited From GlobalEventHandlers.ontouchcancel

ontouchend

ontouchend?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Inherited From GlobalEventHandlers.ontouchend

ontouchmove

ontouchmove?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Inherited From GlobalEventHandlers.ontouchmove

ontouchstart

ontouchstart?: null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TouchEvent) => any

Inherited From GlobalEventHandlers.ontouchstart

ontransitioncancel

ontransitioncancel: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Inherited From GlobalEventHandlers.ontransitioncancel

ontransitionend

ontransitionend: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Inherited From GlobalEventHandlers.ontransitionend

ontransitionrun

ontransitionrun: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Inherited From GlobalEventHandlers.ontransitionrun

ontransitionstart

ontransitionstart: null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: TransitionEvent) => any

Inherited From GlobalEventHandlers.ontransitionstart

onunhandledrejection

onunhandledrejection: null | (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any

Property Value

null | (this: WindowEventHandlers, ev: PromiseRejectionEvent) => any

Inherited From WindowEventHandlers.onunhandledrejection

onunload

onunload: null | (this: WindowEventHandlers, ev: Event) => any

Property Value

null | (this: WindowEventHandlers, ev: Event) => any

Inherited From WindowEventHandlers.onunload

onvolumechange

Occurs when the volume is changed, or playback is muted or unmuted.

onvolumechange: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onvolumechange

onwaiting

Occurs when playback stops because the next frame of a video resource is not available.

onwaiting: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onwaiting

onwebkitanimationend

Warning

This API is now deprecated.

This is a legacy alias of onanimationend.

onwebkitanimationend: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onwebkitanimationend

onwebkitanimationiteration

Warning

This API is now deprecated.

This is a legacy alias of onanimationiteration.

onwebkitanimationiteration: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onwebkitanimationiteration

onwebkitanimationstart

Warning

This API is now deprecated.

This is a legacy alias of onanimationstart.

onwebkitanimationstart: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onwebkitanimationstart

onwebkittransitionend

Warning

This API is now deprecated.

This is a legacy alias of ontransitionend.

onwebkittransitionend: null | (this: GlobalEventHandlers, ev: Event) => any

Property Value

null | (this: GlobalEventHandlers, ev: Event) => any

Inherited From GlobalEventHandlers.onwebkittransitionend

onwheel

onwheel: null | (this: GlobalEventHandlers, ev: WheelEvent) => any

Property Value

null | (this: GlobalEventHandlers, ev: WheelEvent) => any

Inherited From GlobalEventHandlers.onwheel

origin

origin: string

Property Value

string

Inherited From WindowOrWorkerGlobalScope.origin

performance

performance: Performance

Property Value

Performance

Inherited From WindowOrWorkerGlobalScope.performance

sessionStorage

sessionStorage: Storage

Property Value

Storage

Inherited From WindowSessionStorage.sessionStorage

Method Details

addEventListener(string, EventListenerOrEventListenerObject, boolean | AddEventListenerOptions)

function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions)

Parameters

type

string

listener

EventListenerOrEventListenerObject

options

boolean | AddEventListenerOptions

addEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | AddEventListenerOptions)

function addEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions)

Parameters

type

K

listener

(this: Window, ev: WindowEventMap[K]) => any

options

boolean | AddEventListenerOptions

alert(any)

function alert(message?: any)

Parameters

message

any

blur()

function blur()

cancelIdleCallback(number)

function cancelIdleCallback(handle: number)

Parameters

handle

number

captureEvents()

Warning

This API is now deprecated.

function captureEvents()

close()

Closes the window.

function close()

confirm(string)

function confirm(message?: string): boolean

Parameters

message

string

Returns

boolean

focus()

Moves the focus to the window's browsing context, if any.

function focus()

getComputedStyle(Element, null | string)

function getComputedStyle(elt: Element, pseudoElt?: null | string): CSSStyleDeclaration

Parameters

elt

Element

pseudoElt

null | string

Returns

CSSStyleDeclaration

getSelection()

function getSelection(): null | Selection

Returns

null | Selection

matchMedia(string)

function matchMedia(query: string): MediaQueryList

Parameters

query

string

Returns

MediaQueryList

moveBy(number, number)

function moveBy(x: number, y: number)

Parameters

x

number

y

number

moveTo(number, number)

function moveTo(x: number, y: number)

Parameters

x

number

y

number

open(string | URL, string, string)

function open(url?: string | URL, target?: string, features?: string): null | Window

Parameters

url

string | URL

target

string

features

string

Returns

null | Window

postMessage(any, string, Transferable[])

Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.

Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.

A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.

If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".

Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.

function postMessage(message: any, targetOrigin: string, transfer?: Transferable[])

Parameters

message

any

targetOrigin

string

transfer

Transferable[]

postMessage(any, WindowPostMessageOptions)

function postMessage(message: any, options?: WindowPostMessageOptions)

Parameters

message

any

options

WindowPostMessageOptions

print()

function print()

prompt(string, string)

function prompt(message?: string, _default?: string): null | string

Parameters

message

string

_default

string

Returns

null | string

releaseEvents()

Warning

This API is now deprecated.

function releaseEvents()

removeEventListener(string, EventListenerOrEventListenerObject, boolean | EventListenerOptions)

function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions)

Parameters

type

string

listener

EventListenerOrEventListenerObject

options

boolean | EventListenerOptions

removeEventListener<K>(K, (this: Window, ev: WindowEventMap[K]) => any, boolean | EventListenerOptions)

function removeEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions)

Parameters

type

K

listener

(this: Window, ev: WindowEventMap[K]) => any

options

boolean | EventListenerOptions

requestIdleCallback(IdleRequestCallback, IdleRequestOptions)

function requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number

Parameters

callback

IdleRequestCallback

options

IdleRequestOptions

Returns

number

resizeBy(number, number)

function resizeBy(x: number, y: number)

Parameters

x

number

y

number

resizeTo(number, number)

function resizeTo(width: number, height: number)

Parameters

width

number

height

number

scroll(number, number)

function scroll(x: number, y: number)

Parameters

x

number

y

number

scroll(ScrollToOptions)

function scroll(options?: ScrollToOptions)

Parameters

options

ScrollToOptions

scrollBy(number, number)

function scrollBy(x: number, y: number)

Parameters

x

number

y

number

scrollBy(ScrollToOptions)

function scrollBy(options?: ScrollToOptions)

Parameters

options

ScrollToOptions

scrollTo(number, number)

function scrollTo(x: number, y: number)

Parameters

x

number

y

number

scrollTo(ScrollToOptions)

function scrollTo(options?: ScrollToOptions)

Parameters

options

ScrollToOptions

stop()

Cancels the document load.

function stop()

Inherited Method Details

atob(string)

function atob(data: string): string

Parameters

data

string

Returns

string

Inherited From WindowOrWorkerGlobalScope.atob

btoa(string)

function btoa(data: string): string

Parameters

data

string

Returns

string

Inherited From WindowOrWorkerGlobalScope.btoa

cancelAnimationFrame(number)

function cancelAnimationFrame(handle: number)

Parameters

handle

number

Inherited From AnimationFrameProvider.cancelAnimationFrame

clearInterval(undefined | number)

function clearInterval(id: undefined | number)

Parameters

id

undefined | number

Inherited From WindowOrWorkerGlobalScope.clearInterval

clearTimeout(undefined | number)

function clearTimeout(id: undefined | number)

Parameters

id

undefined | number

Inherited From WindowOrWorkerGlobalScope.clearTimeout

createImageBitmap(ImageBitmapSource, ImageBitmapOptions)

function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>

Parameters

image

ImageBitmapSource

options

ImageBitmapOptions

Returns

Promise<ImageBitmap>

Inherited From WindowOrWorkerGlobalScope.createImageBitmap

createImageBitmap(ImageBitmapSource, number, number, number, number, ImageBitmapOptions)

function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>

Parameters

image

ImageBitmapSource

sx

number

sy

number

sw

number

sh

number

options

ImageBitmapOptions

Returns

Promise<ImageBitmap>

Inherited From WindowOrWorkerGlobalScope.createImageBitmap

dispatchEvent(Event)

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

function dispatchEvent(event: Event): boolean

Parameters

event

Event

Returns

boolean

Inherited From EventTarget.dispatchEvent

fetch(URL | RequestInfo, RequestInit)

function fetch(input: URL | RequestInfo, init?: RequestInit): Promise<Response>

Parameters

input

URL | RequestInfo

init

RequestInit

Returns

Promise<Response>

Inherited From WindowOrWorkerGlobalScope.fetch

queueMicrotask(VoidFunction)

function queueMicrotask(callback: VoidFunction)

Parameters

callback

VoidFunction

Inherited From WindowOrWorkerGlobalScope.queueMicrotask

reportError(any)

function reportError(e: any)

Parameters

e

any

Inherited From WindowOrWorkerGlobalScope.reportError

requestAnimationFrame(FrameRequestCallback)

function requestAnimationFrame(callback: FrameRequestCallback): number

Parameters

callback

FrameRequestCallback

Returns

number

Inherited From AnimationFrameProvider.requestAnimationFrame

setInterval(TimerHandler, number, any[])

function setInterval(handler: TimerHandler, timeout?: number, arguments: any[]): number

Parameters

handler

TimerHandler

timeout

number

arguments

any[]

Returns

number

Inherited From WindowOrWorkerGlobalScope.setInterval

setTimeout(TimerHandler, number, any[])

function setTimeout(handler: TimerHandler, timeout?: number, arguments: any[]): number

Parameters

handler

TimerHandler

timeout

number

arguments

any[]

Returns

number

Inherited From WindowOrWorkerGlobalScope.setTimeout

structuredClone(any, StructuredSerializeOptions)

function structuredClone(value: any, options?: StructuredSerializeOptions): any

Parameters

value

any

options

StructuredSerializeOptions

Returns

any

Inherited From WindowOrWorkerGlobalScope.structuredClone