Interface Window

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

MDN Reference

Hierarchy

Indexable

[index: number]: Window

Properties

caches clientInformation closed crossOriginIsolated crypto customElements devicePixelRatio document event external frameElement frames history indexedDB innerHeight innerWidth isSecureContext length localStorage locationbar menubar name navigator onabort onafterprint onanimationcancel onanimationend onanimationiteration onanimationstart onauxclick onbeforeinput onbeforeprint onbeforeunload onbeforexrselect onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncopy oncuechange oncut ondblclick ondevicemotion ondeviceorientation ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onformdata ongamepadconnected ongamepaddisconnected ongotpointercapture onhashchange oninput oninvalid onkeydown onkeypress onkeyup onlanguagechange onload onloadeddata onloadedmetadata onloadstart onlostpointercapture onmessage onmessageerror onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onoffline ononline onorientationchange onpagehide onpageshow onpaste onpause onplay onplaying onpointercancel onpointerdown onpointerenter onpointerleave onpointermove onpointerout onpointerover onpointerup onpopstate onprogress onratechange onrejectionhandled onreset onresize onscroll onsecuritypolicyviolation onseeked onseeking onselect onselectionchange onselectstart onslotchange onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle ontouchcancel? ontouchend? ontouchmove? ontouchstart? ontransitioncancel ontransitionend ontransitionrun ontransitionstart onunhandledrejection onunload onvolumechange onwaiting onwebkitanimationend onwebkitanimationiteration onwebkitanimationstart onwebkittransitionend onwheel opener orientation origin outerHeight outerWidth pageXOffset pageYOffset parent performance personalbar screen screenLeft screenTop screenX screenY scrollX scrollY scrollbars self sessionStorage speechSynthesis status statusbar toolbar top visualViewport window

Methods

Properties

caches: CacheStorage

Available only in secure contexts.

MDN Reference

clientInformation: Navigator

Deprecated

This is a legacy alias of navigator.

MDN Reference

closed: boolean

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

MDN Reference

crossOriginIsolated: boolean
crypto: Crypto
customElements: CustomElementRegistry

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

MDN Reference

devicePixelRatio: number
document: Document
event: Event

Deprecated

MDN Reference

external: External

Deprecated

MDN Reference

frameElement: Element
frames: Window
history: History
indexedDB: IDBFactory
innerHeight: number
innerWidth: number
isSecureContext: boolean
length: number
localStorage: Storage
locationbar: BarProp

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

MDN Reference

menubar: BarProp

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

MDN Reference

name: string
navigator: Navigator
onabort: ((this, ev) => any)

Type declaration

onafterprint: ((this, ev) => any)

Type declaration

onanimationcancel: ((this, ev) => any)

Type declaration

onanimationend: ((this, ev) => any)

Type declaration

onanimationiteration: ((this, ev) => any)

Type declaration

onanimationstart: ((this, ev) => any)

Type declaration

onauxclick: ((this, ev) => any)

Type declaration

onbeforeinput: ((this, ev) => any)

Type declaration

onbeforeprint: ((this, ev) => any)

Type declaration

onbeforeunload: ((this, ev) => any)

Type declaration

onbeforexrselect: ((this, ev) => any)

Type declaration

    • (this, ev): any
    • An XRSessionEvent of type beforexrselect is dispatched on the DOM overlay element before generating a WebXR selectstart input event if the -Z axis of the input source's targetRaySpace intersects the DOM overlay element at the time the input device's primary action is triggered.

      Parameters

      Returns any

onblur: ((this, ev) => any)

Type declaration

oncancel: ((this, ev) => any)

Type declaration

oncanplay: ((this, ev) => any)

Type declaration

oncanplaythrough: ((this, ev) => any)

Type declaration

onchange: ((this, ev) => any)

Type declaration

onclick: ((this, ev) => any)

Type declaration

onclose: ((this, ev) => any)

Type declaration

oncontextmenu: ((this, ev) => any)

Type declaration

oncopy: ((this, ev) => any)

Type declaration

oncuechange: ((this, ev) => any)

Type declaration

oncut: ((this, ev) => any)

Type declaration

ondblclick: ((this, ev) => any)

Type declaration

ondevicemotion: ((this, ev) => any)

Type declaration

ondeviceorientation: ((this, ev) => any)

Type declaration

ondrag: ((this, ev) => any)

Type declaration

ondragend: ((this, ev) => any)

Type declaration

ondragenter: ((this, ev) => any)

Type declaration

ondragleave: ((this, ev) => any)

Type declaration

    • (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

      Returns any

ondragover: ((this, ev) => any)

Type declaration

ondragstart: ((this, ev) => any)

Type declaration

ondrop: ((this, ev) => any)

Type declaration

ondurationchange: ((this, ev) => any)

Type declaration

onemptied: ((this, ev) => any)

Type declaration

onended: ((this, ev) => any)

Type declaration

Fires when an error occurs during object loading.

Param

The event.

MDN Reference

onfocus: ((this, ev) => any)

Type declaration

onformdata: ((this, ev) => any)

Type declaration

ongamepadconnected: ((this, ev) => any)

Type declaration

ongamepaddisconnected: ((this, ev) => any)

Type declaration

ongotpointercapture: ((this, ev) => any)

Type declaration

onhashchange: ((this, ev) => any)

Type declaration

oninput: ((this, ev) => any)

Type declaration

oninvalid: ((this, ev) => any)

Type declaration

onkeydown: ((this, ev) => any)

Type declaration

onkeypress: ((this, ev) => any)

Type declaration

onkeyup: ((this, ev) => any)

Type declaration

onlanguagechange: ((this, ev) => any)

Type declaration

onload: ((this, ev) => any)

Type declaration

onloadeddata: ((this, ev) => any)

Type declaration

onloadedmetadata: ((this, ev) => any)

Type declaration

onloadstart: ((this, ev) => any)

Type declaration

onlostpointercapture: ((this, ev) => any)

Type declaration

onmessage: ((this, ev) => any)

Type declaration

onmessageerror: ((this, ev) => any)

Type declaration

onmousedown: ((this, ev) => any)

Type declaration

onmouseenter: ((this, ev) => any)

Type declaration

onmouseleave: ((this, ev) => any)

Type declaration

onmousemove: ((this, ev) => any)

Type declaration

onmouseout: ((this, ev) => any)

Type declaration

onmouseover: ((this, ev) => any)

Type declaration

onmouseup: ((this, ev) => any)

Type declaration

onoffline: ((this, ev) => any)

Type declaration

ononline: ((this, ev) => any)

Type declaration

onorientationchange: ((this, ev) => any)

Type declaration

onpagehide: ((this, ev) => any)

Type declaration

onpageshow: ((this, ev) => any)

Type declaration

onpaste: ((this, ev) => any)

Type declaration

onpause: ((this, ev) => any)

Type declaration

onplay: ((this, ev) => any)

Type declaration

onplaying: ((this, ev) => any)

Type declaration

onpointercancel: ((this, ev) => any)

Type declaration

onpointerdown: ((this, ev) => any)

Type declaration

onpointerenter: ((this, ev) => any)

Type declaration

onpointerleave: ((this, ev) => any)

Type declaration

onpointermove: ((this, ev) => any)

Type declaration

onpointerout: ((this, ev) => any)

Type declaration

onpointerover: ((this, ev) => any)

Type declaration

onpointerup: ((this, ev) => any)

Type declaration

onpopstate: ((this, ev) => any)

Type declaration

onprogress: ((this, ev) => any)

Type declaration

onratechange: ((this, ev) => any)

Type declaration

onrejectionhandled: ((this, ev) => any)

Type declaration

onreset: ((this, ev) => any)

Type declaration

onresize: ((this, ev) => any)

Type declaration

onscroll: ((this, ev) => any)

Type declaration

onsecuritypolicyviolation: ((this, ev) => any)

Type declaration

onseeked: ((this, ev) => any)

Type declaration

onseeking: ((this, ev) => any)

Type declaration

onselect: ((this, ev) => any)

Type declaration

onselectionchange: ((this, ev) => any)

Type declaration

onselectstart: ((this, ev) => any)

Type declaration

onslotchange: ((this, ev) => any)

Type declaration

onstalled: ((this, ev) => any)

Type declaration

onstorage: ((this, ev) => any)

Type declaration

onsubmit: ((this, ev) => any)

Type declaration

onsuspend: ((this, ev) => any)

Type declaration

ontimeupdate: ((this, ev) => any)

Type declaration

ontoggle: ((this, ev) => any)

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

ontransitioncancel: ((this, ev) => any)

Type declaration

ontransitionend: ((this, ev) => any)

Type declaration

ontransitionrun: ((this, ev) => any)

Type declaration

ontransitionstart: ((this, ev) => any)

Type declaration

onunhandledrejection: ((this, ev) => any)

Type declaration

onunload: ((this, ev) => any)

Type declaration

onvolumechange: ((this, ev) => any)

Type declaration

onwaiting: ((this, ev) => any)

Type declaration

    • (this, ev): any
    • Occurs when playback stops because the next frame of a video resource is not available.

      Parameters

      Returns any

onwebkitanimationend: ((this, ev) => any)

Type declaration

onwebkitanimationiteration: ((this, ev) => any)

Type declaration

onwebkitanimationstart: ((this, ev) => any)

Type declaration

onwebkittransitionend: ((this, ev) => any)

Type declaration

onwheel: ((this, ev) => any)

Type declaration

opener: any
orientation: number

Deprecated

MDN Reference

origin: string
outerHeight: number
outerWidth: number
pageXOffset: number

Deprecated

This is a legacy alias of scrollX.

MDN Reference

pageYOffset: number

Deprecated

This is a legacy alias of scrollY.

MDN Reference

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

performance: Performance
personalbar: BarProp

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

MDN Reference

screen: Screen
screenLeft: number
screenTop: number
screenX: number
screenY: number
scrollX: number
scrollY: number
scrollbars: BarProp

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

MDN Reference

self: Window & typeof globalThis
sessionStorage: Storage
speechSynthesis: SpeechSynthesis
status: string

Deprecated

MDN Reference

statusbar: BarProp

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

MDN Reference

toolbar: BarProp

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

MDN Reference

top: Window
visualViewport: VisualViewport
window: Window & typeof globalThis

Methods

  • Parameters

    • Optional message: any

    Returns void

  • Parameters

    • handle: number

    Returns void

  • Parameters

    • Optional message: string

    Returns 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

    Returns boolean

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

    MDN Reference

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • Optional url: string | URL
    • Optional target: string
    • Optional features: string

    Returns Window

  • 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
    • Optional transfer: Transferable[]

    Returns void

  • Parameters

    Returns void

  • Parameters

    • Optional message: string
    • Optional _default: string

    Returns string

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • width: number
    • height: number

    Returns void

  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

  • Cancels the document load.

    MDN Reference

    Returns void