Skip to main content

Interface: Window

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

MDN Reference

Extends

  • EventTarget.AnimationFrameProvider.GlobalEventHandlers.WindowEventHandlers.WindowLocalStorage.WindowOrWorkerGlobalScope.WindowSessionStorage

Indexable

[index: number]: Window

Properties

CustomersCanvas

CustomersCanvas: object

IframeApi

IframeApi: object

IframeApi.editorUrl

editorUrl: string


HTMLElement

HTMLElement: {(): HTMLElement; prototype: HTMLElement; }

Returns

HTMLElement

prototype

prototype: HTMLElement


Math

Math: Math


onabort

onabort: (this, ev) => any

Fires when the user aborts the download.

Parameters

this

GlobalEventHandlers

ev

UIEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onabort


onanimationcancel

onanimationcancel: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

AnimationEvent

Returns

any

Inherited from

GlobalEventHandlers.onanimationcancel


onanimationend

onanimationend: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

AnimationEvent

Returns

any

Inherited from

GlobalEventHandlers.onanimationend


onanimationiteration

onanimationiteration: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

AnimationEvent

Returns

any

Inherited from

GlobalEventHandlers.onanimationiteration


onanimationstart

onanimationstart: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

AnimationEvent

Returns

any

Inherited from

GlobalEventHandlers.onanimationstart


onauxclick

onauxclick: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

MouseEvent

Returns

any

Inherited from

GlobalEventHandlers.onauxclick


onbeforeinput

onbeforeinput: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

InputEvent

Returns

any

Inherited from

GlobalEventHandlers.onbeforeinput


onbeforetoggle

onbeforetoggle: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onbeforetoggle


onblur

onblur: (this, ev) => any

Fires when the object loses the input focus.

Parameters

this

GlobalEventHandlers

ev

FocusEvent

The focus event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onblur


oncancel

oncancel: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oncancel


oncanplay

oncanplay: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.oncanplay


oncanplaythrough

oncanplaythrough: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oncanplaythrough


onchange

onchange: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onchange


onclick

onclick: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onclick


onclose

onclose: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onclose


oncontextlost

oncontextlost: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oncontextlost


oncontextmenu

oncontextmenu: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.oncontextmenu


oncontextrestored

oncontextrestored: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oncontextrestored


oncopy

oncopy: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

ClipboardEvent

Returns

any

Inherited from

GlobalEventHandlers.oncopy


oncuechange

oncuechange: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oncuechange


oncut

oncut: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

ClipboardEvent

Returns

any

Inherited from

GlobalEventHandlers.oncut


ondblclick

ondblclick: (this, ev) => any

Fires when the user double-clicks the object.

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondblclick


ondrag

ondrag: (this, ev) => any

Fires on the source object continuously during a drag operation.

Parameters

this

GlobalEventHandlers

ev

DragEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondrag


ondragend

ondragend: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

DragEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondragend


ondragenter

ondragenter: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

DragEvent

The drag event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondragenter


ondragleave

ondragleave: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

DragEvent

The drag event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondragleave


ondragover

ondragover: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

DragEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondragover


ondragstart

ondragstart: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

DragEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondragstart


ondrop

ondrop: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

DragEvent

Returns

any

Inherited from

GlobalEventHandlers.ondrop


ondurationchange

ondurationchange: (this, ev) => any

Occurs when the duration attribute is updated.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ondurationchange


onemptied

onemptied: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onemptied


onended

onended: (this, ev) => any

Occurs when the end of playback is reached.

Parameters

this

GlobalEventHandlers

ev

Event

The event

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onended


onerror

onerror: OnErrorEventHandlerNonNull

Fires when an error occurs during object loading.

Param

The event.

MDN Reference

Inherited from

GlobalEventHandlers.onerror


onfocus

onfocus: (this, ev) => any

Fires when the object receives focus.

Parameters

this

GlobalEventHandlers

ev

FocusEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onfocus


onformdata

onformdata: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

FormDataEvent

Returns

any

Inherited from

GlobalEventHandlers.onformdata


ongotpointercapture

ongotpointercapture: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.ongotpointercapture


oninput

oninput: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oninput


oninvalid

oninvalid: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.oninvalid


onkeydown

onkeydown: (this, ev) => any

Fires when the user presses a key.

Parameters

this

GlobalEventHandlers

ev

KeyboardEvent

The keyboard event

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onkeydown


onkeypress

onkeypress: (this, ev) => any

Fires when the user presses an alphanumeric key.

Parameters

this

GlobalEventHandlers

ev

KeyboardEvent

The event.

Returns

any

Deprecated

MDN Reference

Inherited from

GlobalEventHandlers.onkeypress


onkeyup

onkeyup: (this, ev) => any

Fires when the user releases a key.

Parameters

this

GlobalEventHandlers

ev

KeyboardEvent

The keyboard event

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onkeyup


onload

onload: (this, ev) => any

Fires immediately after the browser loads the object.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onload


onloadeddata

onloadeddata: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onloadeddata


onloadedmetadata

onloadedmetadata: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onloadedmetadata


onloadstart

onloadstart: (this, ev) => any

Occurs when Internet Explorer begins looking for media data.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onloadstart


onlostpointercapture

onlostpointercapture: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onlostpointercapture


onmousedown

onmousedown: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onmousedown


onmouseenter

onmouseenter: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

MouseEvent

Returns

any

Inherited from

GlobalEventHandlers.onmouseenter


onmouseleave

onmouseleave: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

MouseEvent

Returns

any

Inherited from

GlobalEventHandlers.onmouseleave


onmousemove

onmousemove: (this, ev) => any

Fires when the user moves the mouse over the object.

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onmousemove


onmouseout

onmouseout: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onmouseout


onmouseover

onmouseover: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onmouseover


onmouseup

onmouseup: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

MouseEvent

The mouse event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onmouseup


onpaste

onpaste: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

ClipboardEvent

Returns

any

Inherited from

GlobalEventHandlers.onpaste


onpause

onpause: (this, ev) => any

Occurs when playback is paused.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onpause


onplay

onplay: (this, ev) => any

Occurs when the play method is requested.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onplay


onplaying

onplaying: (this, ev) => any

Occurs when the audio or video has started playing.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onplaying


onpointercancel

onpointercancel: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointercancel


onpointerdown

onpointerdown: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerdown


onpointerenter

onpointerenter: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerenter


onpointerleave

onpointerleave: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerleave


onpointermove

onpointermove: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointermove


onpointerout

onpointerout: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerout


onpointerover

onpointerover: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerover


onpointerup

onpointerup: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

PointerEvent

Returns

any

Inherited from

GlobalEventHandlers.onpointerup


onprogress

onprogress: (this, ev) => any

Occurs to indicate progress while downloading media data.

Parameters

this

GlobalEventHandlers

ev

ProgressEvent

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onprogress


onratechange

onratechange: (this, ev) => any

Occurs when the playback rate is increased or decreased.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onratechange


onreset

onreset: (this, ev) => any

Fires when the user resets a form.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onreset


onresize

onresize: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

UIEvent

Returns

any

Inherited from

GlobalEventHandlers.onresize


onscroll

onscroll: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onscroll


onscrollend

onscrollend: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onscrollend


onsecuritypolicyviolation

onsecuritypolicyviolation: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

SecurityPolicyViolationEvent

Returns

any

Inherited from

GlobalEventHandlers.onsecuritypolicyviolation


onseeked

onseeked: (this, ev) => any

Occurs when the seek operation ends.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onseeked


onseeking

onseeking: (this, ev) => any

Occurs when the current playback position is moved.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onseeking


onselect

onselect: (this, ev) => any

Fires when the current selection changes.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onselect


onselectionchange

onselectionchange: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onselectionchange


onselectstart

onselectstart: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onselectstart


onslotchange

onslotchange: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.onslotchange


onstalled

onstalled: (this, ev) => any

Occurs when the download has stopped.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onstalled


onsubmit

onsubmit: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

SubmitEvent

Returns

any

Inherited from

GlobalEventHandlers.onsubmit


onsuspend

onsuspend: (this, ev) => any

Occurs if the load operation has been intentionally halted.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onsuspend


ontimeupdate

ontimeupdate: (this, ev) => any

Occurs to indicate the current playback position.

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.ontimeupdate


ontoggle

ontoggle: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Inherited from

GlobalEventHandlers.ontoggle


ontouchcancel?

optional ontouchcancel?: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TouchEvent

Returns

any

Inherited from

GlobalEventHandlers.ontouchcancel


ontouchend?

optional ontouchend?: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TouchEvent

Returns

any

Inherited from

GlobalEventHandlers.ontouchend


ontouchmove?

optional ontouchmove?: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TouchEvent

Returns

any

Inherited from

GlobalEventHandlers.ontouchmove


ontouchstart?

optional ontouchstart?: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TouchEvent

Returns

any

Inherited from

GlobalEventHandlers.ontouchstart


ontransitioncancel

ontransitioncancel: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TransitionEvent

Returns

any

Inherited from

GlobalEventHandlers.ontransitioncancel


ontransitionend

ontransitionend: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TransitionEvent

Returns

any

Inherited from

GlobalEventHandlers.ontransitionend


ontransitionrun

ontransitionrun: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TransitionEvent

Returns

any

Inherited from

GlobalEventHandlers.ontransitionrun


ontransitionstart

ontransitionstart: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

TransitionEvent

Returns

any

Inherited from

GlobalEventHandlers.ontransitionstart


onvolumechange

onvolumechange: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onvolumechange


onwaiting

onwaiting: (this, ev) => any

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

Parameters

this

GlobalEventHandlers

ev

Event

The event.

MDN Reference

Returns

any

Inherited from

GlobalEventHandlers.onwaiting


onwebkitanimationend

onwebkitanimationend: (this, ev) => any

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Deprecated

This is a legacy alias of onanimationend.

MDN Reference

Inherited from

GlobalEventHandlers.onwebkitanimationend


onwebkitanimationiteration

onwebkitanimationiteration: (this, ev) => any

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Deprecated

This is a legacy alias of onanimationiteration.

MDN Reference

Inherited from

GlobalEventHandlers.onwebkitanimationiteration


onwebkitanimationstart

onwebkitanimationstart: (this, ev) => any

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Deprecated

This is a legacy alias of onanimationstart.

MDN Reference

Inherited from

GlobalEventHandlers.onwebkitanimationstart


onwebkittransitionend

onwebkittransitionend: (this, ev) => any

Parameters

this

GlobalEventHandlers

ev

Event

Returns

any

Deprecated

This is a legacy alias of ontransitionend.

MDN Reference

Inherited from

GlobalEventHandlers.onwebkittransitionend


onwheel

onwheel: (this, ev) => any

MDN Reference

Parameters

this

GlobalEventHandlers

ev

WheelEvent

Returns

any

Inherited from

GlobalEventHandlers.onwheel


clientInformation

readonly clientInformation: Navigator

Deprecated

This is a legacy alias of navigator.

MDN Reference


closed

readonly closed: boolean

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

MDN Reference


customElements

readonly customElements: CustomElementRegistry

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

MDN Reference


devicePixelRatio

readonly devicePixelRatio: number

MDN Reference


document

readonly document: Document

MDN Reference


event

readonly event: Event

Deprecated

MDN Reference


external

readonly external: External

Deprecated

MDN Reference


frameElement

readonly frameElement: Element

MDN Reference


frames

readonly frames: Window

MDN Reference


history

readonly history: History

MDN Reference


innerHeight

readonly innerHeight: number

MDN Reference


innerWidth

readonly innerWidth: number

MDN Reference


length

readonly length: number

MDN Reference


locationbar

readonly locationbar: BarProp

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

MDN Reference


readonly menubar: BarProp

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

MDN Reference


name

name: string

MDN Reference


readonly navigator: Navigator

MDN Reference


ondevicemotion

ondevicemotion: (this, ev) => any

Available only in secure contexts.

MDN Reference

Parameters

this

Window

ev

DeviceMotionEvent

Returns

any


ondeviceorientation

ondeviceorientation: (this, ev) => any

Available only in secure contexts.

MDN Reference

Parameters

this

Window

ev

DeviceOrientationEvent

Returns

any


ondeviceorientationabsolute

ondeviceorientationabsolute: (this, ev) => any

Available only in secure contexts.

MDN Reference

Parameters

this

Window

ev

DeviceOrientationEvent

Returns

any


onorientationchange

onorientationchange: (this, ev) => any

Parameters

this

Window

ev

Event

Returns

any

Deprecated

MDN Reference


opener

opener: any

MDN Reference


orientation

readonly orientation: number

Deprecated

MDN Reference


outerHeight

readonly outerHeight: number

MDN Reference


outerWidth

readonly outerWidth: number

MDN Reference


pageXOffset

readonly pageXOffset: number

Deprecated

This is a legacy alias of scrollX.

MDN Reference


pageYOffset

readonly pageYOffset: number

Deprecated

This is a legacy alias of scrollY.

MDN Reference


parent

readonly parent: Window

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.

MDN Reference


personalbar

readonly personalbar: BarProp

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

MDN Reference


screen

readonly screen: Screen

MDN Reference


screenLeft

readonly screenLeft: number

MDN Reference


screenTop

readonly screenTop: number

MDN Reference


screenX

readonly screenX: number

MDN Reference


screenY

readonly screenY: number

MDN Reference


scrollX

readonly scrollX: number

MDN Reference


scrollY

readonly scrollY: number

MDN Reference


scrollbars

readonly scrollbars: BarProp

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

MDN Reference


self

readonly self: Window & typeof globalThis

MDN Reference


speechSynthesis

readonly speechSynthesis: SpeechSynthesis

MDN Reference


status

status: string

Deprecated

MDN Reference


statusbar

readonly statusbar: BarProp

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

MDN Reference


toolbar

readonly toolbar: BarProp

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

MDN Reference


top

readonly top: Window

MDN Reference


visualViewport

readonly visualViewport: VisualViewport

MDN Reference


window

readonly window: Window & typeof globalThis

MDN Reference


onafterprint

onafterprint: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Inherited from

WindowEventHandlers.onafterprint


onbeforeprint

onbeforeprint: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Inherited from

WindowEventHandlers.onbeforeprint


onbeforeunload

onbeforeunload: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

BeforeUnloadEvent

Returns

any

Inherited from

WindowEventHandlers.onbeforeunload


ongamepadconnected

ongamepadconnected: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

GamepadEvent

Returns

any

Inherited from

WindowEventHandlers.ongamepadconnected


ongamepaddisconnected

ongamepaddisconnected: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

GamepadEvent

Returns

any

Inherited from

WindowEventHandlers.ongamepaddisconnected


onhashchange

onhashchange: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

HashChangeEvent

Returns

any

Inherited from

WindowEventHandlers.onhashchange


onlanguagechange

onlanguagechange: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Inherited from

WindowEventHandlers.onlanguagechange


onmessage

onmessage: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

MessageEvent

Returns

any

Inherited from

WindowEventHandlers.onmessage


onmessageerror

onmessageerror: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

MessageEvent

Returns

any

Inherited from

WindowEventHandlers.onmessageerror


onoffline

onoffline: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Inherited from

WindowEventHandlers.onoffline


ononline

ononline: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Inherited from

WindowEventHandlers.ononline


onpagehide

onpagehide: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

PageTransitionEvent

Returns

any

Inherited from

WindowEventHandlers.onpagehide


onpageshow

onpageshow: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

PageTransitionEvent

Returns

any

Inherited from

WindowEventHandlers.onpageshow


onpopstate

onpopstate: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

PopStateEvent

Returns

any

Inherited from

WindowEventHandlers.onpopstate


onrejectionhandled

onrejectionhandled: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

PromiseRejectionEvent

Returns

any

Inherited from

WindowEventHandlers.onrejectionhandled


onstorage

onstorage: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

StorageEvent

Returns

any

Inherited from

WindowEventHandlers.onstorage


onunhandledrejection

onunhandledrejection: (this, ev) => any

MDN Reference

Parameters

this

WindowEventHandlers

ev

PromiseRejectionEvent

Returns

any

Inherited from

WindowEventHandlers.onunhandledrejection


onunload

onunload: (this, ev) => any

Parameters

this

WindowEventHandlers

ev

Event

Returns

any

Deprecated

MDN Reference

Inherited from

WindowEventHandlers.onunload


localStorage

readonly localStorage: Storage

MDN Reference

Inherited from

WindowLocalStorage.localStorage


caches

readonly caches: CacheStorage

Available only in secure contexts.

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.caches


crossOriginIsolated

readonly crossOriginIsolated: boolean

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.crossOriginIsolated


crypto

readonly crypto: Crypto

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.crypto


indexedDB

readonly indexedDB: IDBFactory

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.indexedDB


isSecureContext

readonly isSecureContext: boolean

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.isSecureContext


origin

readonly origin: string

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.origin


performance

readonly performance: Performance

MDN Reference

Inherited from

WindowOrWorkerGlobalScope.performance


sessionStorage

readonly sessionStorage: Storage

MDN Reference

Inherited from

WindowSessionStorage.sessionStorage

Accessors

location

Get Signature

get location(): Location

MDN Reference

Returns

Location

Set Signature

set location(href): void

Parameters
href

string | Location

Returns

void

Methods

cancelAnimationFrame()

cancelAnimationFrame(handle): void

MDN Reference

Parameters

handle

number

Returns

void

Inherited from

AnimationFrameProvider.cancelAnimationFrame


requestAnimationFrame()

requestAnimationFrame(callback): number

MDN Reference

Parameters

callback

FrameRequestCallback

Returns

number

Inherited from

AnimationFrameProvider.requestAnimationFrame


dispatchEvent()

dispatchEvent(event): boolean

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.

MDN Reference

Parameters

event

Event

Returns

boolean

Inherited from

EventTarget.dispatchEvent


alert()

alert(message?): void

MDN Reference

Parameters

message?

any

Returns

void


blur()

blur(): void

Returns

void

Deprecated

MDN Reference


cancelIdleCallback()

cancelIdleCallback(handle): void

MDN Reference

Parameters

handle

number

Returns

void


captureEvents()

captureEvents(): void

Returns

void

Deprecated

MDN Reference


close()

close(): void

Closes the window.

MDN Reference

Returns

void


confirm()

confirm(message?): boolean

MDN Reference

Parameters

message?

string

Returns

boolean


focus()

focus(): void

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

MDN Reference

Returns

void


getComputedStyle()

getComputedStyle(elt, pseudoElt?): CSSStyleDeclaration

MDN Reference

Parameters

elt

Element

pseudoElt?

string

Returns

CSSStyleDeclaration


getSelection()

getSelection(): Selection

MDN Reference

Returns

Selection


matchMedia()

matchMedia(query): MediaQueryList

MDN Reference

Parameters

query

string

Returns

MediaQueryList


moveBy()

moveBy(x, y): void

MDN Reference

Parameters

x

number

y

number

Returns

void


moveTo()

moveTo(x, y): void

MDN Reference

Parameters

x

number

y

number

Returns

void


open()

open(url?, target?, features?): Window

MDN Reference

Parameters

url?

string | URL

target?

string

features?

string

Returns

Window


postMessage()

Call Signature

postMessage(message, targetOrigin, transfer?): void

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.

MDN Reference

Parameters
message

any

targetOrigin

string

transfer?

Transferable[]

Returns

void

Call Signature

postMessage(message, options?): void

Parameters
message

any

options?

WindowPostMessageOptions

Returns

void


print()

print(): void

MDN Reference

Returns

void


prompt()

prompt(message?, default?): string

MDN Reference

Parameters

message?

string

default?

string

Returns

string


releaseEvents()

releaseEvents(): void

Returns

void

Deprecated

MDN Reference


requestIdleCallback()

Call Signature

requestIdleCallback(callback, options?): number

MDN Reference

Parameters
callback

IdleRequestCallback

options?

IdleRequestOptions

Returns

number

Call Signature

requestIdleCallback(callback): () => void

Parameters
callback

(deadline) => void

Returns

() => void


resizeBy()

resizeBy(x, y): void

MDN Reference

Parameters

x

number

y

number

Returns

void


resizeTo()

resizeTo(width, height): void

MDN Reference

Parameters

width

number

height

number

Returns

void


scroll()

Call Signature

scroll(options?): void

MDN Reference

Parameters
options?

ScrollToOptions

Returns

void

Call Signature

scroll(x, y): void

Parameters
x

number

y

number

Returns

void


scrollBy()

Call Signature

scrollBy(options?): void

MDN Reference

Parameters
options?

ScrollToOptions

Returns

void

Call Signature

scrollBy(x, y): void

Parameters
x

number

y

number

Returns

void


scrollTo()

Call Signature

scrollTo(options?): void

MDN Reference

Parameters
options?

ScrollToOptions

Returns

void

Call Signature

scrollTo(x, y): void

Parameters
x

number

y

number

Returns

void


stop()

stop(): void

Cancels the document load.

MDN Reference

Returns

void


addEventListener()

Call Signature

addEventListener<K>(type, listener, options?): void

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Type Parameters
K

K extends keyof WindowEventMap

Parameters
type

K

listener

(this, ev) => any

options?

boolean | AddEventListenerOptions

Returns

void

Overrides

EventTarget.addEventListener

Call Signature

addEventListener(type, listener, options?): void

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Parameters
type

string

listener

EventListenerOrEventListenerObject

options?

boolean | AddEventListenerOptions

Returns

void

Overrides

EventTarget.addEventListener


removeEventListener()

Call Signature

removeEventListener<K>(type, listener, options?): void

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Type Parameters
K

K extends keyof WindowEventMap

Parameters
type

K

listener

(this, ev) => any

options?

boolean | EventListenerOptions

Returns

void

Overrides

EventTarget.removeEventListener

Call Signature

removeEventListener(type, listener, options?): void

Removes the event listener in target's event listener list with the same type, callback, and options.

MDN Reference

Parameters
type

string

listener

EventListenerOrEventListenerObject

options?

boolean | EventListenerOptions

Returns

void

Overrides

EventTarget.removeEventListener


atob()

atob(data): string

MDN Reference

Parameters

data

string

Returns

string

Inherited from

WindowOrWorkerGlobalScope.atob


btoa()

btoa(data): string

MDN Reference

Parameters

data

string

Returns

string

Inherited from

WindowOrWorkerGlobalScope.btoa


clearInterval()

clearInterval(id): void

MDN Reference

Parameters

id

number

Returns

void

Inherited from

WindowOrWorkerGlobalScope.clearInterval


clearTimeout()

clearTimeout(id): void

MDN Reference

Parameters

id

number

Returns

void

Inherited from

WindowOrWorkerGlobalScope.clearTimeout


createImageBitmap()

Call Signature

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

MDN Reference

Parameters
image

ImageBitmapSource

options?

ImageBitmapOptions

Returns

Promise<ImageBitmap>

Inherited from

WindowOrWorkerGlobalScope.createImageBitmap

Call Signature

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

Parameters
image

ImageBitmapSource

sx

number

sy

number

sw

number

sh

number

options?

ImageBitmapOptions

Returns

Promise<ImageBitmap>

Inherited from

WindowOrWorkerGlobalScope.createImageBitmap


fetch()

fetch(input, init?): Promise<Response>

MDN Reference

Parameters

input

URL | RequestInfo

init?

RequestInit

Returns

Promise<Response>

Inherited from

WindowOrWorkerGlobalScope.fetch


queueMicrotask()

queueMicrotask(callback): void

MDN Reference

Parameters

callback

VoidFunction

Returns

void

Inherited from

WindowOrWorkerGlobalScope.queueMicrotask


reportError()

reportError(e): void

MDN Reference

Parameters

e

any

Returns

void

Inherited from

WindowOrWorkerGlobalScope.reportError


setInterval()

setInterval(handler, timeout?, ...arguments): number

MDN Reference

Parameters

handler

TimerHandler

timeout?

number

arguments

...any[]

Returns

number

Inherited from

WindowOrWorkerGlobalScope.setInterval


setTimeout()

setTimeout(handler, timeout?, ...arguments): number

MDN Reference

Parameters

handler

TimerHandler

timeout?

number

arguments

...any[]

Returns

number

Inherited from

WindowOrWorkerGlobalScope.setTimeout


structuredClone()

structuredClone<T>(value, options?): T

MDN Reference

Type Parameters

T

T = any

Parameters

value

T

options?

StructuredSerializeOptions

Returns

T

Inherited from

WindowOrWorkerGlobalScope.structuredClone

Was this page helpful?