Window Class

https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-window-object. A window only exists for the documents of a Window.BrowsingContext. It is the global object of the realm of the BrowsingContextOptions.ScriptEngine, if any. The members that need a rendering or a user interaction (dialogs...) are not implemented.

public sealed class Window : GlobalScope

Remarks

The WindowProxy exotic object is not modeled: the members returning a WindowProxy return the active window of the browsing context. A window is reused when an initial about:blank document is replaced by a same-origin document, as specified.

See also

Inheritance
GlobalScope Window

Properties

NameDescription
BrowsingContextThe browsing context of the associated document (https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-bc), or null when it was destroyed.
Closedhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-closed
CookieStoreGets the Cookie Store API of the window (https://cookiestore.spec.whatwg.org/#dom-window-cookiestore).
Credentiallesshttps://wicg.github.io/anonymous-iframe/#dom-window-credentialless: whether the document is loaded in a credentialless iframe.
CrossOriginIsolatedhttps://html.spec.whatwg.org/multipage/webappapis.html#dom-crossoriginisolated: the cross-origin isolation mode of the browsing context group is "concrete" (its top-level document has the opener policy "same-origin" and an embedder policy compatible with cross-origin isolation), and the document may use the "cross-origin-isolated" feature (https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-cross-origin-isolated-capability).
CustomElementshttps://html.spec.whatwg.org/multipage/custom-elements.html#dom-window-customelements
DevicePixelRatioGets the number of device pixels per CSS pixel (https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio): ViewportOptions.DevicePixelRatio.
Documenthttps://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window
Eventhttps://dom.spec.whatwg.org/#dom-window-event: the event being dispatched to a listener whose callback's global object is this window.
Externalhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-external: the obsolete External object.
FrameElementhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-frameelement
Historyhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history: the history object of the associated document.
InnerHeightGets the height of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerheight): ViewportOptions.Height, or the height of the iframe.
InnerWidthGets the width of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerwidth): ViewportOptions.Width, or the width of the iframe.
IsSecureContexthttps://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
LengthThe number of document-tree child navigables (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-length).
LocalStorageGets the local storage area of the origin of the document (https://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage), from the storage shed of the browsing context (BrowsingContextOptions.LocalStorage). Throws a SecurityError when the origin of the document is opaque, or when the WebStoragePersistence of the shed cannot load the items.
Locationhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location
LocationBarhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-locationbar: the location bar BarProp object of the window.
MenuBarhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-menubar: the menu bar BarProp object of the window.
Namehttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-name
Navigationhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation
Navigatorhttps://html.spec.whatwg.org/multipage/system-state.html#dom-navigator
OnAbortGets or sets the event handler of the abort event (the onabort event handler attribute).
OnAfterPrintGets or sets the event handler of the afterprint event (the onafterprint event handler attribute).
OnAnimationCancelGets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).
OnAnimationEndGets or sets the event handler of the animationend event (the onanimationend event handler attribute).
OnAnimationIterationGets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).
OnAnimationStartGets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).
OnAuxClickGets or sets the event handler of the auxclick event (the onauxclick event handler attribute).
OnBeforeInputGets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).
OnBeforeMatchGets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).
OnBeforePrintGets or sets the event handler of the beforeprint event (the onbeforeprint event handler attribute).
OnBeforeToggleGets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).
OnBeforeUnloadGets or sets the event handler of the beforeunload event (the onbeforeunload event handler attribute).
OnBlurGets or sets the event handler of the blur event (the onblur event handler attribute).
OnCanPlayGets or sets the event handler of the canplay event (the oncanplay event handler attribute).
OnCanPlayThroughGets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).
OnCancelGets or sets the event handler of the cancel event (the oncancel event handler attribute).
OnChangeGets or sets the event handler of the change event (the onchange event handler attribute).
OnClickGets or sets the event handler of the click event (the onclick event handler attribute).
OnCloseGets or sets the event handler of the close event (the onclose event handler attribute).
OnCommandGets or sets the event handler of the command event (the oncommand event handler attribute).
OnContentVisibilityAutoStateChangeGets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute).
OnContextMenuGets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).
OnContextRestoredGets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).
OnContextlostGets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).
OnCopyGets or sets the event handler of the copy event (the oncopy event handler attribute).
OnCueChangeGets or sets the event handler of the cuechange event (the oncuechange event handler attribute).
OnCutGets or sets the event handler of the cut event (the oncut event handler attribute).
OnDblClickGets or sets the event handler of the dblclick event (the ondblclick event handler attribute).
OnDeviceMotionGets or sets the event handler of the devicemotion event.
OnDeviceOrientationGets or sets the event handler of the deviceorientation event.
OnDeviceOrientationAbsoluteGets or sets the event handler of the deviceorientationabsolute event.
OnDragGets or sets the event handler of the drag event (the ondrag event handler attribute).
OnDragEndGets or sets the event handler of the dragend event (the ondragend event handler attribute).
OnDragEnterGets or sets the event handler of the dragenter event (the ondragenter event handler attribute).
OnDragLeaveGets or sets the event handler of the dragleave event (the ondragleave event handler attribute).
OnDragOverGets or sets the event handler of the dragover event (the ondragover event handler attribute).
OnDragStartGets or sets the event handler of the dragstart event (the ondragstart event handler attribute).
OnDropGets or sets the event handler of the drop event (the ondrop event handler attribute).
OnDurationChangeGets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).
OnEmptiedGets or sets the event handler of the emptied event (the onemptied event handler attribute).
OnEndedGets or sets the event handler of the ended event (the onended event handler attribute).
OnErrorGets or sets the event handler of the error event (the onerror event handler attribute).
OnFocusGets or sets the event handler of the focus event (the onfocus event handler attribute).
OnFormDataGets or sets the event handler of the formdata event (the onformdata event handler attribute).
OnGotPointerCaptureGets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).
OnHashChangeGets or sets the event handler of the hashchange event (the onhashchange event handler attribute).
OnInputGets or sets the event handler of the input event (the oninput event handler attribute).
OnInvalidGets or sets the event handler of the invalid event (the oninvalid event handler attribute).
OnKeyDownGets or sets the event handler of the keydown event (the onkeydown event handler attribute).
OnKeyPressGets or sets the event handler of the keypress event (the onkeypress event handler attribute).
OnKeyUpGets or sets the event handler of the keyup event (the onkeyup event handler attribute).
OnLanguageChangeGets or sets the event handler of the languagechange event (the onlanguagechange event handler attribute).
OnLoadGets or sets the event handler of the load event (the onload event handler attribute).
OnLoadStartGets or sets the event handler of the loadstart event (the onloadstart event handler attribute).
OnLoadedDataGets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).
OnLoadedMetadataGets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).
OnLostPointerCaptureGets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).
OnMessageGets or sets the event handler of the message event (the onmessage event handler attribute).
OnMessageErrorGets or sets the event handler of the messageerror event (the onmessageerror event handler attribute).
OnMouseDownGets or sets the event handler of the mousedown event (the onmousedown event handler attribute).
OnMouseEnterGets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).
OnMouseLeaveGets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).
OnMouseMoveGets or sets the event handler of the mousemove event (the onmousemove event handler attribute).
OnMouseOutGets or sets the event handler of the mouseout event (the onmouseout event handler attribute).
OnMouseOverGets or sets the event handler of the mouseover event (the onmouseover event handler attribute).
OnMouseUpGets or sets the event handler of the mouseup event (the onmouseup event handler attribute).
OnOfflineGets or sets the event handler of the offline event (the onoffline event handler attribute).
OnOnlineGets or sets the event handler of the online event (the ononline event handler attribute).
OnPageHideGets or sets the event handler of the pagehide event (the onpagehide event handler attribute).
OnPageRevealGets or sets the event handler of the pagereveal event (the onpagereveal event handler attribute).
OnPageShowGets or sets the event handler of the pageshow event (the onpageshow event handler attribute).
OnPageSwapGets or sets the event handler of the pageswap event (the onpageswap event handler attribute).
OnPasteGets or sets the event handler of the paste event (the onpaste event handler attribute).
OnPauseGets or sets the event handler of the pause event (the onpause event handler attribute).
OnPlayGets or sets the event handler of the play event (the onplay event handler attribute).
OnPlayingGets or sets the event handler of the playing event (the onplaying event handler attribute).
OnPointerCancelGets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).
OnPointerDownGets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).
OnPointerEnterGets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).
OnPointerLeaveGets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).
OnPointerMoveGets or sets the event handler of the pointermove event (the onpointermove event handler attribute).
OnPointerOutGets or sets the event handler of the pointerout event (the onpointerout event handler attribute).
OnPointerOverGets or sets the event handler of the pointerover event (the onpointerover event handler attribute).
OnPointerRawUpdateGets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).
OnPointerUpGets or sets the event handler of the pointerup event (the onpointerup event handler attribute).
OnPopStateGets or sets the event handler of the popstate event (the onpopstate event handler attribute).
OnProgressGets or sets the event handler of the progress event (the onprogress event handler attribute).
OnRateChangeGets or sets the event handler of the ratechange event (the onratechange event handler attribute).
OnRejectionHandledGets or sets the event handler of the rejectionhandled event (the onrejectionhandled event handler attribute).
OnResetGets or sets the event handler of the reset event (the onreset event handler attribute).
OnResizeGets or sets the event handler of the resize event (the onresize event handler attribute).
OnScrollGets or sets the event handler of the scroll event (the onscroll event handler attribute).
OnScrollEndGets or sets the event handler of the scrollend event (the onscrollend event handler attribute).
OnScrollSnapChangeGets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).
OnScrollSnapChangingGets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).
OnSecurityPolicyViolationGets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).
OnSeekedGets or sets the event handler of the seeked event (the onseeked event handler attribute).
OnSeekingGets or sets the event handler of the seeking event (the onseeking event handler attribute).
OnSelectGets or sets the event handler of the select event (the onselect event handler attribute).
OnSelectStartGets or sets the event handler of the selectstart event (the onselectstart event handler attribute).
OnSelectionChangeGets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).
OnSlotChangeGets or sets the event handler of the slotchange event (the onslotchange event handler attribute).
OnStalledGets or sets the event handler of the stalled event (the onstalled event handler attribute).
OnStorageGets or sets the event handler of the storage event (the onstorage event handler attribute).
OnSubmitGets or sets the event handler of the submit event (the onsubmit event handler attribute).
OnSuspendGets or sets the event handler of the suspend event (the onsuspend event handler attribute).
OnTimeUpdateGets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).
OnToggleGets or sets the event handler of the toggle event (the ontoggle event handler attribute).
OnTransitionCancelGets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).
OnTransitionEndGets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).
OnTransitionRunGets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).
OnTransitionStartGets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).
OnUnhandledRejectionGets or sets the event handler of the unhandledrejection event (the onunhandledrejection event handler attribute).
OnUnloadGets or sets the event handler of the unload event (the onunload event handler attribute).
OnVolumeChangeGets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).
OnWaitingGets or sets the event handler of the waiting event (the onwaiting event handler attribute).
OnWebkitAnimationEndGets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).
OnWebkitAnimationIterationGets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).
OnWebkitAnimationStartGets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).
OnWebkitTransitionEndGets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).
OnWheelGets or sets the event handler of the wheel event (the onwheel event handler attribute).
Openerhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-opener: the window of the opener browsing context of an auxiliary browsing context, or null (also once the opener is discarded, e.g. closed). Setting it to null disowns the opener.
Originhttps://html.spec.whatwg.org/multipage/webappapis.html#dom-origin
OriginAgentClusterhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-originagentcluster: whether the agent cluster of the window is origin-keyed.
OuterHeightGets the height of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerheight): see Window.OuterWidth.
OuterWidthGets the width of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerwidth): the width of the viewport of the top-level browsing context (the client window has no decoration), or 0 without browsing context.
Parenthttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-parent
PersonalBarhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-personalbar: the personal bar BarProp object of the window.
ScreenGets the screen of the window (https://drafts.csswg.org/cssom-view/#dom-window-screen).
ScreenXGets the horizontal position of the client window on the screen (https://drafts.csswg.org/cssom-view/#dom-window-screenx): 0, or the position requested by the left feature of the window.open() that created the top-level browsing context.
ScreenYGets the vertical position of the client window on the screen (https://drafts.csswg.org/cssom-view/#dom-window-screeny): see Window.ScreenX.
ScrollBarshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-scrollbars: the scrollbar BarProp object of the window.
ScrollXGets the horizontal scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollx): the x coordinate of the left of the viewport relative to the initial containing block, or 0 without viewport.
ScrollYGets the vertical scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrolly): see Window.ScrollX.
Selfhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window
SessionStorageGets the session storage area of the origin of the document in its top-level browsing context (https://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage). Throws a SecurityError when the origin of the document is opaque.
StatusThe status bar text: the last value it was set to (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-status).
StatusBarhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-statusbar: the status bar BarProp object of the window.
ToolBarhttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-toolbar: the toolbar BarProp object of the window.
Tophttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-top
TrustedTypeshttps://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes
ViewportGets the viewport of the window (https://drafts.csswg.org/css-viewport/#dom-window-viewport).
VisualViewportGets the visual viewport of the document (https://drafts.csswg.org/cssom-view/#dom-window-visualviewport), or null when the document is not fully active.

BrowsingContext

Window.cs

The browsing context of the associated document (https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-bc), or null when it was destroyed.

public BrowsingContext? BrowsingContext { get; }

Property value

BrowsingContext?

Closed

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-closed

public bool Closed { get; }

CookieStore

Window.cs

Gets the Cookie Store API of the window (https://cookiestore.spec.whatwg.org/#dom-window-cookiestore).

public CookieStore CookieStore { get; }

Credentialless

Window.cs

https://wicg.github.io/anonymous-iframe/#dom-window-credentialless: whether the document is loaded in a credentialless iframe.

public bool Credentialless { get; }

CrossOriginIsolated

Window.cs

https://html.spec.whatwg.org/multipage/webappapis.html#dom-crossoriginisolated: the cross-origin isolation mode of the browsing context group is "concrete" (its top-level document has the opener policy "same-origin" and an embedder policy compatible with cross-origin isolation), and the document may use the "cross-origin-isolated" feature (https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-cross-origin-isolated-capability).

public override bool CrossOriginIsolated { get; }

CustomElements

Window.cs

https://html.spec.whatwg.org/multipage/custom-elements.html#dom-window-customelements

public CustomElementRegistry CustomElements { get; }

DevicePixelRatio

CssomView.cs

Gets the number of device pixels per CSS pixel (https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio): ViewportOptions.DevicePixelRatio.

public double DevicePixelRatio { get; }

Document

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window

public Document Document { get; }

https://dom.spec.whatwg.org/#dom-window-event: the event being dispatched to a listener whose callback's global object is this window.

public Event? Event { get; }

External

Window.cs

https://html.spec.whatwg.org/multipage/obsolete.html#dom-external: the obsolete External object.

public External External { get; }

FrameElement

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-frameelement

public Element? FrameElement { get; }

History

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history: the history object of the associated document.

public History History { get; }

InnerHeight

CssomView.cs

Gets the height of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerheight): ViewportOptions.Height, or the height of the iframe.

public int InnerHeight { get; }

InnerWidth

CssomView.cs

Gets the width of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerwidth): ViewportOptions.Width, or the width of the iframe.

public int InnerWidth { get; }

IsSecureContext

Window.cs

https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext

public override bool IsSecureContext { get; }

Length

Window.cs

The number of document-tree child navigables (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-length).

public uint Length { get; }

Gets the local storage area of the origin of the document (https://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage), from the storage shed of the browsing context (BrowsingContextOptions.LocalStorage). Throws a SecurityError when the origin of the document is opaque, or when the WebStoragePersistence of the shed cannot load the items.

public Storage LocalStorage { get; }

Location

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location

public Location Location { get; }

LocationBar

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-locationbar: the location bar BarProp object of the window.

public BarProp LocationBar { get; }

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-name

public string Name { get; set; }

Gets or sets the event handler of the abort event (the onabort event handler attribute).

public Action<Event>? OnAbort { get; set; }

OnAfterPrint

Window.g.cs

Gets or sets the event handler of the afterprint event (the onafterprint event handler attribute).

public Action<Event>? OnAfterPrint { get; set; }

OnAnimationCancel

Window.g.cs

Gets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).

public Action<Event>? OnAnimationCancel { get; set; }

OnAnimationEnd

Window.g.cs

Gets or sets the event handler of the animationend event (the onanimationend event handler attribute).

public Action<Event>? OnAnimationEnd { get; set; }

OnAnimationIteration

Window.g.cs

Gets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).

public Action<Event>? OnAnimationIteration { get; set; }

OnAnimationStart

Window.g.cs

Gets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).

public Action<Event>? OnAnimationStart { get; set; }

OnAuxClick

Window.g.cs

Gets or sets the event handler of the auxclick event (the onauxclick event handler attribute).

public Action<Event>? OnAuxClick { get; set; }

OnBeforeInput

Window.g.cs

Gets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).

public Action<Event>? OnBeforeInput { get; set; }

OnBeforeMatch

Window.g.cs

Gets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).

public Action<Event>? OnBeforeMatch { get; set; }

OnBeforePrint

Window.g.cs

Gets or sets the event handler of the beforeprint event (the onbeforeprint event handler attribute).

public Action<Event>? OnBeforePrint { get; set; }

OnBeforeToggle

Window.g.cs

Gets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).

public Action<Event>? OnBeforeToggle { get; set; }

OnBeforeUnload

Window.g.cs

Gets or sets the event handler of the beforeunload event (the onbeforeunload event handler attribute).

public Action<Event>? OnBeforeUnload { get; set; }

Gets or sets the event handler of the blur event (the onblur event handler attribute).

public Action<Event>? OnBlur { get; set; }

OnCanPlay

Window.g.cs

Gets or sets the event handler of the canplay event (the oncanplay event handler attribute).

public Action<Event>? OnCanPlay { get; set; }

OnCanPlayThrough

Window.g.cs

Gets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).

public Action<Event>? OnCanPlayThrough { get; set; }

OnCancel

Window.g.cs

Gets or sets the event handler of the cancel event (the oncancel event handler attribute).

public Action<Event>? OnCancel { get; set; }

OnChange

Window.g.cs

Gets or sets the event handler of the change event (the onchange event handler attribute).

public Action<Event>? OnChange { get; set; }

Gets or sets the event handler of the click event (the onclick event handler attribute).

public Action<Event>? OnClick { get; set; }

Gets or sets the event handler of the close event (the onclose event handler attribute).

public Action<Event>? OnClose { get; set; }

OnCommand

Window.g.cs

Gets or sets the event handler of the command event (the oncommand event handler attribute).

public Action<Event>? OnCommand { get; set; }

OnContentVisibilityAutoStateChange

Window.g.cs
  • Experimental (WEBPLATEXP0010)

Gets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute).

[Experimental("WEBPLATEXP0010", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public Action<Event>? OnContentVisibilityAutoStateChange { get; set; }

OnContextMenu

Window.g.cs

Gets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).

public Action<Event>? OnContextMenu { get; set; }

OnContextRestored

Window.g.cs

Gets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).

public Action<Event>? OnContextRestored { get; set; }

OnContextlost

Window.g.cs

Gets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).

public Action<Event>? OnContextlost { get; set; }

Gets or sets the event handler of the copy event (the oncopy event handler attribute).

public Action<Event>? OnCopy { get; set; }

OnCueChange

Window.g.cs

Gets or sets the event handler of the cuechange event (the oncuechange event handler attribute).

public Action<Event>? OnCueChange { get; set; }

Gets or sets the event handler of the cut event (the oncut event handler attribute).

public Action<Event>? OnCut { get; set; }

OnDblClick

Window.g.cs

Gets or sets the event handler of the dblclick event (the ondblclick event handler attribute).

public Action<Event>? OnDblClick { get; set; }

Gets or sets the event handler of the devicemotion event.

public Action<Event>? OnDeviceMotion { get; set; }

OnDeviceOrientation

DeviceOrientationEvents.cs

Gets or sets the event handler of the deviceorientation event.

public Action<Event>? OnDeviceOrientation { get; set; }

OnDeviceOrientationAbsolute

DeviceOrientationEvents.cs

Gets or sets the event handler of the deviceorientationabsolute event.

public Action<Event>? OnDeviceOrientationAbsolute { get; set; }

Gets or sets the event handler of the drag event (the ondrag event handler attribute).

public Action<Event>? OnDrag { get; set; }

OnDragEnd

Window.g.cs

Gets or sets the event handler of the dragend event (the ondragend event handler attribute).

public Action<Event>? OnDragEnd { get; set; }

OnDragEnter

Window.g.cs

Gets or sets the event handler of the dragenter event (the ondragenter event handler attribute).

public Action<Event>? OnDragEnter { get; set; }

OnDragLeave

Window.g.cs

Gets or sets the event handler of the dragleave event (the ondragleave event handler attribute).

public Action<Event>? OnDragLeave { get; set; }

OnDragOver

Window.g.cs

Gets or sets the event handler of the dragover event (the ondragover event handler attribute).

public Action<Event>? OnDragOver { get; set; }

OnDragStart

Window.g.cs

Gets or sets the event handler of the dragstart event (the ondragstart event handler attribute).

public Action<Event>? OnDragStart { get; set; }

Gets or sets the event handler of the drop event (the ondrop event handler attribute).

public Action<Event>? OnDrop { get; set; }

OnDurationChange

Window.g.cs

Gets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).

public Action<Event>? OnDurationChange { get; set; }

OnEmptied

Window.g.cs

Gets or sets the event handler of the emptied event (the onemptied event handler attribute).

public Action<Event>? OnEmptied { get; set; }

Gets or sets the event handler of the ended event (the onended event handler attribute).

public Action<Event>? OnEnded { get; set; }

Gets or sets the event handler of the error event (the onerror event handler attribute).

public Action<Event>? OnError { get; set; }

Gets or sets the event handler of the focus event (the onfocus event handler attribute).

public Action<Event>? OnFocus { get; set; }

OnFormData

Window.g.cs

Gets or sets the event handler of the formdata event (the onformdata event handler attribute).

public Action<Event>? OnFormData { get; set; }

OnGotPointerCapture

Window.g.cs

Gets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).

public Action<Event>? OnGotPointerCapture { get; set; }

OnHashChange

Window.g.cs

Gets or sets the event handler of the hashchange event (the onhashchange event handler attribute).

public Action<Event>? OnHashChange { get; set; }

Gets or sets the event handler of the input event (the oninput event handler attribute).

public Action<Event>? OnInput { get; set; }

OnInvalid

Window.g.cs

Gets or sets the event handler of the invalid event (the oninvalid event handler attribute).

public Action<Event>? OnInvalid { get; set; }

OnKeyDown

Window.g.cs

Gets or sets the event handler of the keydown event (the onkeydown event handler attribute).

public Action<Event>? OnKeyDown { get; set; }

OnKeyPress

Window.g.cs

Gets or sets the event handler of the keypress event (the onkeypress event handler attribute).

public Action<Event>? OnKeyPress { get; set; }

Gets or sets the event handler of the keyup event (the onkeyup event handler attribute).

public Action<Event>? OnKeyUp { get; set; }

OnLanguageChange

Window.g.cs

Gets or sets the event handler of the languagechange event (the onlanguagechange event handler attribute).

public Action<Event>? OnLanguageChange { get; set; }

Gets or sets the event handler of the load event (the onload event handler attribute).

public Action<Event>? OnLoad { get; set; }

OnLoadStart

Window.g.cs

Gets or sets the event handler of the loadstart event (the onloadstart event handler attribute).

public Action<Event>? OnLoadStart { get; set; }

OnLoadedData

Window.g.cs

Gets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).

public Action<Event>? OnLoadedData { get; set; }

OnLoadedMetadata

Window.g.cs

Gets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).

public Action<Event>? OnLoadedMetadata { get; set; }

OnLostPointerCapture

Window.g.cs

Gets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).

public Action<Event>? OnLostPointerCapture { get; set; }

OnMessage

Window.g.cs

Gets or sets the event handler of the message event (the onmessage event handler attribute).

public Action<Event>? OnMessage { get; set; }

OnMessageError

Window.g.cs

Gets or sets the event handler of the messageerror event (the onmessageerror event handler attribute).

public Action<Event>? OnMessageError { get; set; }

OnMouseDown

Window.g.cs

Gets or sets the event handler of the mousedown event (the onmousedown event handler attribute).

public Action<Event>? OnMouseDown { get; set; }

OnMouseEnter

Window.g.cs

Gets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).

public Action<Event>? OnMouseEnter { get; set; }

OnMouseLeave

Window.g.cs

Gets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).

public Action<Event>? OnMouseLeave { get; set; }

OnMouseMove

Window.g.cs

Gets or sets the event handler of the mousemove event (the onmousemove event handler attribute).

public Action<Event>? OnMouseMove { get; set; }

OnMouseOut

Window.g.cs

Gets or sets the event handler of the mouseout event (the onmouseout event handler attribute).

public Action<Event>? OnMouseOut { get; set; }

OnMouseOver

Window.g.cs

Gets or sets the event handler of the mouseover event (the onmouseover event handler attribute).

public Action<Event>? OnMouseOver { get; set; }

OnMouseUp

Window.g.cs

Gets or sets the event handler of the mouseup event (the onmouseup event handler attribute).

public Action<Event>? OnMouseUp { get; set; }

OnOffline

Window.g.cs

Gets or sets the event handler of the offline event (the onoffline event handler attribute).

public Action<Event>? OnOffline { get; set; }

OnOnline

Window.g.cs

Gets or sets the event handler of the online event (the ononline event handler attribute).

public Action<Event>? OnOnline { get; set; }

OnPageHide

Window.g.cs

Gets or sets the event handler of the pagehide event (the onpagehide event handler attribute).

public Action<Event>? OnPageHide { get; set; }

OnPageReveal

Window.g.cs

Gets or sets the event handler of the pagereveal event (the onpagereveal event handler attribute).

public Action<Event>? OnPageReveal { get; set; }

OnPageShow

Window.g.cs

Gets or sets the event handler of the pageshow event (the onpageshow event handler attribute).

public Action<Event>? OnPageShow { get; set; }

OnPageSwap

Window.g.cs

Gets or sets the event handler of the pageswap event (the onpageswap event handler attribute).

public Action<Event>? OnPageSwap { get; set; }

Gets or sets the event handler of the paste event (the onpaste event handler attribute).

public Action<Event>? OnPaste { get; set; }

Gets or sets the event handler of the pause event (the onpause event handler attribute).

public Action<Event>? OnPause { get; set; }

Gets or sets the event handler of the play event (the onplay event handler attribute).

public Action<Event>? OnPlay { get; set; }

OnPlaying

Window.g.cs

Gets or sets the event handler of the playing event (the onplaying event handler attribute).

public Action<Event>? OnPlaying { get; set; }

OnPointerCancel

Window.g.cs

Gets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).

public Action<Event>? OnPointerCancel { get; set; }

OnPointerDown

Window.g.cs

Gets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).

public Action<Event>? OnPointerDown { get; set; }

OnPointerEnter

Window.g.cs

Gets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).

public Action<Event>? OnPointerEnter { get; set; }

OnPointerLeave

Window.g.cs

Gets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).

public Action<Event>? OnPointerLeave { get; set; }

OnPointerMove

Window.g.cs

Gets or sets the event handler of the pointermove event (the onpointermove event handler attribute).

public Action<Event>? OnPointerMove { get; set; }

OnPointerOut

Window.g.cs

Gets or sets the event handler of the pointerout event (the onpointerout event handler attribute).

public Action<Event>? OnPointerOut { get; set; }

OnPointerOver

Window.g.cs

Gets or sets the event handler of the pointerover event (the onpointerover event handler attribute).

public Action<Event>? OnPointerOver { get; set; }

OnPointerRawUpdate

Window.g.cs

Gets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).

public Action<Event>? OnPointerRawUpdate { get; set; }

OnPointerUp

Window.g.cs

Gets or sets the event handler of the pointerup event (the onpointerup event handler attribute).

public Action<Event>? OnPointerUp { get; set; }

OnPopState

Window.g.cs

Gets or sets the event handler of the popstate event (the onpopstate event handler attribute).

public Action<Event>? OnPopState { get; set; }

OnProgress

Window.g.cs

Gets or sets the event handler of the progress event (the onprogress event handler attribute).

public Action<Event>? OnProgress { get; set; }

OnRateChange

Window.g.cs

Gets or sets the event handler of the ratechange event (the onratechange event handler attribute).

public Action<Event>? OnRateChange { get; set; }

OnRejectionHandled

Window.g.cs

Gets or sets the event handler of the rejectionhandled event (the onrejectionhandled event handler attribute).

public Action<Event>? OnRejectionHandled { get; set; }

Gets or sets the event handler of the reset event (the onreset event handler attribute).

public Action<Event>? OnReset { get; set; }

OnResize

Window.g.cs

Gets or sets the event handler of the resize event (the onresize event handler attribute).

public Action<Event>? OnResize { get; set; }

OnScroll

Window.g.cs

Gets or sets the event handler of the scroll event (the onscroll event handler attribute).

public Action<Event>? OnScroll { get; set; }

OnScrollEnd

Window.g.cs

Gets or sets the event handler of the scrollend event (the onscrollend event handler attribute).

public Action<Event>? OnScrollEnd { get; set; }

OnScrollSnapChange

Window.g.cs

Gets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).

public Action<Event>? OnScrollSnapChange { get; set; }

OnScrollSnapChanging

Window.g.cs

Gets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).

public Action<Event>? OnScrollSnapChanging { get; set; }

OnSecurityPolicyViolation

Window.g.cs

Gets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).

public Action<Event>? OnSecurityPolicyViolation { get; set; }

OnSeeked

Window.g.cs

Gets or sets the event handler of the seeked event (the onseeked event handler attribute).

public Action<Event>? OnSeeked { get; set; }

OnSeeking

Window.g.cs

Gets or sets the event handler of the seeking event (the onseeking event handler attribute).

public Action<Event>? OnSeeking { get; set; }

OnSelect

Window.g.cs

Gets or sets the event handler of the select event (the onselect event handler attribute).

public Action<Event>? OnSelect { get; set; }

OnSelectStart

Window.g.cs

Gets or sets the event handler of the selectstart event (the onselectstart event handler attribute).

public Action<Event>? OnSelectStart { get; set; }

OnSelectionChange

Window.g.cs

Gets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).

public Action<Event>? OnSelectionChange { get; set; }

OnSlotChange

Window.g.cs

Gets or sets the event handler of the slotchange event (the onslotchange event handler attribute).

public Action<Event>? OnSlotChange { get; set; }

OnStalled

Window.g.cs

Gets or sets the event handler of the stalled event (the onstalled event handler attribute).

public Action<Event>? OnStalled { get; set; }

OnStorage

Window.g.cs

Gets or sets the event handler of the storage event (the onstorage event handler attribute).

public Action<Event>? OnStorage { get; set; }

OnSubmit

Window.g.cs

Gets or sets the event handler of the submit event (the onsubmit event handler attribute).

public Action<Event>? OnSubmit { get; set; }

OnSuspend

Window.g.cs

Gets or sets the event handler of the suspend event (the onsuspend event handler attribute).

public Action<Event>? OnSuspend { get; set; }

OnTimeUpdate

Window.g.cs

Gets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).

public Action<Event>? OnTimeUpdate { get; set; }

OnToggle

Window.g.cs

Gets or sets the event handler of the toggle event (the ontoggle event handler attribute).

public Action<Event>? OnToggle { get; set; }

OnTransitionCancel

Window.g.cs

Gets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).

public Action<Event>? OnTransitionCancel { get; set; }

OnTransitionEnd

Window.g.cs

Gets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).

public Action<Event>? OnTransitionEnd { get; set; }

OnTransitionRun

Window.g.cs

Gets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).

public Action<Event>? OnTransitionRun { get; set; }

OnTransitionStart

Window.g.cs

Gets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).

public Action<Event>? OnTransitionStart { get; set; }

OnUnhandledRejection

Window.g.cs

Gets or sets the event handler of the unhandledrejection event (the onunhandledrejection event handler attribute).

public Action<Event>? OnUnhandledRejection { get; set; }

OnUnload

Window.g.cs

Gets or sets the event handler of the unload event (the onunload event handler attribute).

public Action<Event>? OnUnload { get; set; }

OnVolumeChange

Window.g.cs

Gets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).

public Action<Event>? OnVolumeChange { get; set; }

OnWaiting

Window.g.cs

Gets or sets the event handler of the waiting event (the onwaiting event handler attribute).

public Action<Event>? OnWaiting { get; set; }

OnWebkitAnimationEnd

Window.g.cs

Gets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).

public Action<Event>? OnWebkitAnimationEnd { get; set; }

OnWebkitAnimationIteration

Window.g.cs

Gets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).

public Action<Event>? OnWebkitAnimationIteration { get; set; }

OnWebkitAnimationStart

Window.g.cs

Gets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).

public Action<Event>? OnWebkitAnimationStart { get; set; }

OnWebkitTransitionEnd

Window.g.cs

Gets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).

public Action<Event>? OnWebkitTransitionEnd { get; set; }

Gets or sets the event handler of the wheel event (the onwheel event handler attribute).

public Action<Event>? OnWheel { get; set; }

Opener

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-opener: the window of the opener browsing context of an auxiliary browsing context, or null (also once the opener is discarded, e.g. closed). Setting it to null disowns the opener.

public object? Opener { get; set; }

Origin

Window.cs

https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin

public override string Origin { get; }

OriginAgentCluster

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-originagentcluster: whether the agent cluster of the window is origin-keyed.

public bool OriginAgentCluster { get; }

Gets the height of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerheight): see Window.OuterWidth.

public int OuterHeight { get; }

Gets the width of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerwidth): the width of the viewport of the top-level browsing context (the client window has no decoration), or 0 without browsing context.

public int OuterWidth { get; }

Parent

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-parent

public Window? Parent { get; }

PersonalBar

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-personalbar: the personal bar BarProp object of the window.

public BarProp PersonalBar { get; }

Gets the screen of the window (https://drafts.csswg.org/cssom-view/#dom-window-screen).

public Screen Screen { get; }

Gets the horizontal position of the client window on the screen (https://drafts.csswg.org/cssom-view/#dom-window-screenx): 0, or the position requested by the left feature of the window.open() that created the top-level browsing context.

public int ScreenX { get; }

Gets the vertical position of the client window on the screen (https://drafts.csswg.org/cssom-view/#dom-window-screeny): see Window.ScreenX.

public int ScreenY { get; }

ScrollBars

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-scrollbars: the scrollbar BarProp object of the window.

public BarProp ScrollBars { get; }

Gets the horizontal scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollx): the x coordinate of the left of the viewport relative to the initial containing block, or 0 without viewport.

public double ScrollX { get; }

Gets the vertical scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrolly): see Window.ScrollX.

public double ScrollY { get; }

SessionStorage

Window.WebStorage.cs

Gets the session storage area of the origin of the document in its top-level browsing context (https://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage). Throws a SecurityError when the origin of the document is opaque.

public Storage SessionStorage { get; }

Status

Window.cs

The status bar text: the last value it was set to (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-status).

public string Status { get; set; }

StatusBar

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-statusbar: the status bar BarProp object of the window.

public BarProp StatusBar { get; }

ToolBar

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-toolbar: the toolbar BarProp object of the window.

public BarProp ToolBar { get; }

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-top

public Window? Top { get; }

https://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes

public TrustedTypePolicyFactory TrustedTypes { get; }

Viewport

Viewport.cs

Gets the viewport of the window (https://drafts.csswg.org/css-viewport/#dom-window-viewport).

public Viewport Viewport { get; }

Gets the visual viewport of the document (https://drafts.csswg.org/cssom-view/#dom-window-visualviewport), or null when the document is not fully active.

public VisualViewport? VisualViewport { get; }

Indexers

NameDescription
this[int]Returns the window of the document-tree child navigable at the given index (https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-getownproperty), or null. The child navigables are indexed in the order in which their containers were inserted into the document (the order of their creation), not in tree order.

this[int]

Window.cs

Returns the window of the document-tree child navigable at the given index (https://html.spec.whatwg.org/multipage/nav-history-apis.html#windowproxy-getownproperty), or null. The child navigables are indexed in the order in which their containers were inserted into the document (the order of their creation), not in tree order.

public Window? this[int index] { get; }

Parameters

index int

Property value

Window?

Methods

NameDescription
Alert()https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert: shows an empty message with BrowsingContextOptions.UserPromptHandler (without handler, it does nothing).
Alert(string)https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert: shows the message with BrowsingContextOptions.UserPromptHandler (without handler, it does nothing).
Blur()https://html.spec.whatwg.org/multipage/interaction.html#dom-window-blur: does nothing.
CancelAnimationFrame(uint)https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animationframeprovider-cancelanimationframe
CancelIdleCallback(uint)Cancels an idle callback (https://w3c.github.io/requestidlecallback/#the-cancelidlecallback-method). Does nothing when the handle is unknown.
CaptureEvents()https://html.spec.whatwg.org/multipage/obsolete.html#dom-window-captureevents: does nothing.
Close()https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-close
Confirm(string)https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-confirm: asks the question with BrowsingContextOptions.UserPromptHandler, and returns whether the user accepted it (without handler, it returns false).
Focus()https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus: runs the focusing steps for the navigable of the window (its active document). As in the browsers, the document keeps its focused element (see FocusModel.FocusNavigable).
GetComputedStyle(Element, string?)Returns the resolved values of the properties of an element or of one of its pseudo-elements (https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle). The declarations are read-only and live: they reflect the current state of the document and of its style sheets.
GetNamedItem(string)Returns the value of a named property of the window: the window of a document-tree child navigable whose target name is name, an element, or an HtmlCollection of the named objects; or null.
GetSelection()Returns the selection associated with the document of the window.
MatchMedia(string)Returns a MediaQueryList that evaluates a media query list against the environment of the document (https://drafts.csswg.org/cssom-view/#dom-window-matchmedia).
MoveBy(int, int)Moves the window (https://drafts.csswg.org/cssom-view/#dom-window-moveby): there is no client window, nothing happens.
MoveTo(int, int)Moves the window (https://drafts.csswg.org/cssom-view/#dom-window-moveto): there is no client window, nothing happens.
Open(string, string, string)The window open steps (https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-open-steps): navigates the navigable chosen by target, or a new auxiliary browsing context (for _blank and the unknown names), which shares the event loop of this window and is discarded with the browsing context that owns the group.
PostMessage(object?, WindowPostMessageOptions?)Posts a message to the window (https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage-options): runs the window post message steps.
PostMessage(object?, string, IReadOnlyList<object>?)Posts a message to the window (https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage): a message event is fired at the window by a task, when its document has the origin targetOrigin.
Print()https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-print: there is no rendering, so it does nothing.
Prompt(string, string)https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-prompt: asks the question with BrowsingContextOptions.UserPromptHandler, and returns the text the user entered, or null when the user dismissed the dialog (without handler, it returns null).
ReleaseEvents()https://html.spec.whatwg.org/multipage/obsolete.html#dom-window-releaseevents: does nothing.
RequestAnimationFrame(FrameRequestCallback)https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-animationframeprovider-requestanimationframe: runs the callback at the next frame. There is no rendering: the frames run at a fixed rate (60 frames per second) measured with DomEventLoop.TimeProvider.
RequestIdleCallback(IdleRequestCallback, IdleRequestOptions?)Requests a call of callback in an idle period of the event loop (https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method): when no task is queued, until the next timer, the next animation frame, or 50 milliseconds. A callback requested by an idle callback runs in the next idle period. With a timeout, the callback is queued as a task once the timeout elapsed, if no idle period ran it.
RequestResize()https://drafts.csswg.org/css-sizing-4/#dom-window-requestresize: updates the internal layout intrinsic size of the iframe that contains the document from the size of its contents.
ResizeBy(int, int)Resizes the window (https://drafts.csswg.org/cssom-view/#dom-window-resizeby): there is no client window, nothing happens.
ResizeTo(int, int)Resizes the window (https://drafts.csswg.org/cssom-view/#dom-window-resizeto): there is no client window, nothing happens.
Scroll(ScrollToOptions?)Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scroll) to the scroll position of ScrollToOptions.Left and ScrollToOptions.Top (the current ones when they are absent), clamped to its scrolling area. The task completes when the scroll is completed.
Scroll(double, double)Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scroll): see Window.Scroll.
ScrollBy(ScrollToOptions?)Scrolls the viewport by an offset (https://drafts.csswg.org/cssom-view/#dom-window-scrollby): the offsets are added to Window.ScrollX and Window.ScrollY.
ScrollBy(double, double)Scrolls the viewport by an offset (https://drafts.csswg.org/cssom-view/#dom-window-scrollby): see Window.ScrollBy.
ScrollTo(ScrollToOptions?)Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollto): see Window.Scroll.
ScrollTo(double, double)Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollto): see Window.Scroll.
Stop()https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-stop: aborts the ongoing navigation.

Alert overloads

Alert()

Window.cs

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert: shows an empty message with BrowsingContextOptions.UserPromptHandler (without handler, it does nothing).

public void Alert()

Alert(string)

Window.cs

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert: shows the message with BrowsingContextOptions.UserPromptHandler (without handler, it does nothing).

public void Alert(string message)

Blur()

Window.cs

https://html.spec.whatwg.org/multipage/interaction.html#dom-window-blur: does nothing.

public void Blur()

CancelAnimationFrame(uint)

Window.Timers.cs

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animationframeprovider-cancelanimationframe

public void CancelAnimationFrame(uint handle)

CancelIdleCallback(uint)

Window.IdleCallbacks.cs

Cancels an idle callback (https://w3c.github.io/requestidlecallback/#the-cancelidlecallback-method). Does nothing when the handle is unknown.

public void CancelIdleCallback(uint handle)

CaptureEvents()

Window.cs

https://html.spec.whatwg.org/multipage/obsolete.html#dom-window-captureevents: does nothing.

public void CaptureEvents()

Close()

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-close

public void Close()

Confirm(string)

Window.cs

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-confirm: asks the question with BrowsingContextOptions.UserPromptHandler, and returns whether the user accepted it (without handler, it returns false).

public bool Confirm(string message = "")

Focus()

Window.cs

https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus: runs the focusing steps for the navigable of the window (its active document). As in the browsers, the document keeps its focused element (see FocusModel.FocusNavigable).

public void Focus()

GetComputedStyle(Element, string?)

GetComputedStyle.cs

Returns the resolved values of the properties of an element or of one of its pseudo-elements (https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle). The declarations are read-only and live: they reflect the current state of the document and of its style sheets.

public CssStyleProperties GetComputedStyle(Element elt, string? pseudoElt = null)

Parameters

elt Element
pseudoElt string?

Returns

CssStyleProperties

Remarks

Nothing is rendered: the values that depend on the layout (e.g. a width in percentage or auto) are the computed values, the media queries and the viewport-relative lengths use BrowsingContextOptions.Viewport, and the declarations are empty when the element is not connected, not in the flat tree, or in a document without browsing context.

See also

GetNamedItem(string)

Window.cs

Returns the value of a named property of the window: the window of a document-tree child navigable whose target name is name, an element, or an HtmlCollection of the named objects; or null.

public object? GetNamedItem(string name)

Parameters

name string

Returns

object?

GetSelection()

Selection.cs

Returns the selection associated with the document of the window.

public Selection? GetSelection()

MatchMedia(string)

CssomView.cs

Returns a MediaQueryList that evaluates a media query list against the environment of the document (https://drafts.csswg.org/cssom-view/#dom-window-matchmedia).

public MediaQueryList MatchMedia(string query)

MoveBy(int, int)

CssomView.Scrolling.cs

Moves the window (https://drafts.csswg.org/cssom-view/#dom-window-moveby): there is no client window, nothing happens.

public void MoveBy(int x, int y)

MoveTo(int, int)

CssomView.Scrolling.cs

Moves the window (https://drafts.csswg.org/cssom-view/#dom-window-moveto): there is no client window, nothing happens.

public void MoveTo(int x, int y)

Open(string, string, string)

Window.cs

The window open steps (https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-open-steps): navigates the navigable chosen by target, or a new auxiliary browsing context (for _blank and the unknown names), which shares the event loop of this window and is discarded with the browsing context that owns the group.

public Window? Open(string url = "", string target = "_blank", string features = "")

Parameters

url string
The URL to load, relative to the document of the window; the empty string keeps the initial about:blank document.
target string
The target name (_blank when empty).
features string
The window features: noopener and noreferrer, and for a new browsing context, the features that request a popup (BrowsingContext.IsPopup) and the ones that set the size of its viewport and the position of its client window (width, height, left, top and their aliases).

Returns

Window? The window of the target navigable, or null (noopener, noreferrer, or no navigable).

Exceptions

DomException
A SyntaxError when the URL cannot be parsed.

See also

PostMessage overloads

PostMessage(object?, WindowPostMessageOptions?)

Window.Messaging.cs

Posts a message to the window (https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage-options): runs the window post message steps.

public void PostMessage(object? message, WindowPostMessageOptions? options = null)
Parameters
message object?
The message: a value of the script engine, a .NET primitive value or a serializable platform object, or null for undefined.
options WindowPostMessageOptions?
The target origin (/ by default) and the objects to transfer.
Exceptions
DomException
A SyntaxError when the target origin is not a valid URL, or a DataCloneError when the message cannot be serialized.
See also

PostMessage(object?, string, IReadOnlyList<object>?)

Window.Messaging.cs

Posts a message to the window (https://html.spec.whatwg.org/multipage/web-messaging.html#dom-window-postmessage): a message event is fired at the window by a task, when its document has the origin targetOrigin.

public void PostMessage(object? message, string targetOrigin, IReadOnlyList<object>? transfer = null)
Parameters
message object?
The message: a value of the script engine, a .NET primitive value or a serializable platform object, or null for undefined.
targetOrigin string
The origin the document of the window must have: an absolute URL (only its origin is used), * (any origin) or / (the origin of the caller).
transfer IReadOnlyList<object>?
The objects to transfer (the ArrayBuffer objects of the script engine, and the message ports).
Exceptions
DomException
A SyntaxError when targetOrigin is not a valid URL, or a DataCloneError when the message cannot be serialized.
See also

Print()

Window.cs

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-print: there is no rendering, so it does nothing.

public void Print()

Prompt(string, string)

Window.cs

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-prompt: asks the question with BrowsingContextOptions.UserPromptHandler, and returns the text the user entered, or null when the user dismissed the dialog (without handler, it returns null).

public string? Prompt(string message = "", string @default = "")

ReleaseEvents()

Window.cs

https://html.spec.whatwg.org/multipage/obsolete.html#dom-window-releaseevents: does nothing.

public void ReleaseEvents()

RequestAnimationFrame(FrameRequestCallback)

Window.Timers.cs

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-animationframeprovider-requestanimationframe: runs the callback at the next frame. There is no rendering: the frames run at a fixed rate (60 frames per second) measured with DomEventLoop.TimeProvider.

public uint RequestAnimationFrame(FrameRequestCallback callback)

RequestIdleCallback(IdleRequestCallback, IdleRequestOptions?)

Window.IdleCallbacks.cs

Requests a call of callback in an idle period of the event loop (https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method): when no task is queued, until the next timer, the next animation frame, or 50 milliseconds. A callback requested by an idle callback runs in the next idle period. With a timeout, the callback is queued as a task once the timeout elapsed, if no idle period ran it.

public uint RequestIdleCallback(IdleRequestCallback callback, IdleRequestOptions? options = null)

Parameters

callback IdleRequestCallback
The callback.
options IdleRequestOptions?
The timeout of the callback, or null.

Returns

uint The handle of the callback, for Window.CancelIdleCallback.

See also

https://drafts.csswg.org/css-sizing-4/#dom-window-requestresize: updates the internal layout intrinsic size of the iframe that contains the document from the size of its contents.

public void RequestResize()

ResizeBy(int, int)

CssomView.Scrolling.cs

Resizes the window (https://drafts.csswg.org/cssom-view/#dom-window-resizeby): there is no client window, nothing happens.

public void ResizeBy(int x, int y)

ResizeTo(int, int)

CssomView.Scrolling.cs

Resizes the window (https://drafts.csswg.org/cssom-view/#dom-window-resizeto): there is no client window, nothing happens.

public void ResizeTo(int width, int height)

Scroll overloads

Scroll(ScrollToOptions?)

CssomView.Scrolling.cs

Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scroll) to the scroll position of ScrollToOptions.Left and ScrollToOptions.Top (the current ones when they are absent), clamped to its scrolling area. The task completes when the scroll is completed.

public Task Scroll(ScrollToOptions? options = null)

Scroll(double, double)

CssomView.Scrolling.cs

Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scroll): see Window.Scroll.

public Task Scroll(double x, double y)

ScrollBy overloads

ScrollBy(ScrollToOptions?)

CssomView.Scrolling.cs

Scrolls the viewport by an offset (https://drafts.csswg.org/cssom-view/#dom-window-scrollby): the offsets are added to Window.ScrollX and Window.ScrollY.

public Task ScrollBy(ScrollToOptions? options = null)

ScrollBy(double, double)

CssomView.Scrolling.cs

Scrolls the viewport by an offset (https://drafts.csswg.org/cssom-view/#dom-window-scrollby): see Window.ScrollBy.

public Task ScrollBy(double x, double y)

ScrollTo overloads

ScrollTo(ScrollToOptions?)

CssomView.Scrolling.cs

Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollto): see Window.Scroll.

public Task ScrollTo(ScrollToOptions? options = null)

ScrollTo(double, double)

CssomView.Scrolling.cs

Scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollto): see Window.Scroll.

public Task ScrollTo(double x, double y)

Stop()

Window.cs

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-stop: aborts the ongoing navigation.

public void Stop()