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

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 onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange 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 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

Accessors

Methods

Properties

caches: CacheStorage

Available only in secure contexts.

clientInformation: Navigator

Deprecated

This is a legacy alias of navigator.

closed: boolean

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

crossOriginIsolated: boolean
crypto: Crypto
customElements: CustomElementRegistry

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

devicePixelRatio: number
document: Document
event: Event

Deprecated

external: External

Deprecated

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.

menubar: BarProp

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

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

Fires when an error occurs during object loading.

Param

The event.

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

    • (this: Window, ev: Event): any
    • Deprecated

      Parameters

      Returns any

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

    • (this: GlobalEventHandlers, ev: Event): any
    • Fires when the user repositions the scroll box in the scroll bar on the object.

      Parameters

      Returns any

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

      Parameters

      Returns any

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

opener: any
orientation: number

Deprecated

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

Deprecated

This is a legacy alias of scrollX.

pageYOffset: number

Deprecated

This is a legacy alias of scrollY.

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.

performance: Performance
personalbar: BarProp

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

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.

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

Deprecated

statusbar: BarProp

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

toolbar: BarProp

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

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

Accessors

  • get location(): Location
  • Returns Location

  • set location(href: string | Location): void
  • Parameters

    Returns void

Methods

  • Parameters

    • Optional message: any

    Returns void

  • Parameters

    • data: string

    Returns string

  • Returns void

  • Parameters

    • data: string

    Returns string

  • Parameters

    • handle: number

    Returns void

  • Deprecated

    Returns void

  • Closes the window.

    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.

    Parameters

    • event: Event

    Returns boolean

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

    Returns void

  • Parameters

    • elt: Element
    • Optional pseudoElt: string

    Returns CSSStyleDeclaration

  • Returns Selection

  • Parameters

    • query: string

    Returns MediaQueryList

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

    Parameters

    • message: any
    • targetOrigin: string
    • Optional transfer: Transferable[]

    Returns void

  • Parameters

    Returns void

  • Returns void

  • Parameters

    • Optional message: string
    • Optional _default: string

    Returns string

  • Deprecated

    Returns void

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

    Returns void