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 : GlobalScopeRemarks
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
GlobalScopeWindow
Properties
| Name | Description |
|---|---|
| BrowsingContext | 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. |
| Closed | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-closed |
| CookieStore | Gets the Cookie Store API of the window (https://cookiestore.spec.whatwg.org/#dom-window-cookiestore). |
| Credentialless | https://wicg.github.io/anonymous-iframe/#dom-window-credentialless: whether the document is loaded in a credentialless iframe. |
| CrossOriginIsolated | 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). |
| CustomElements | https://html.spec.whatwg.org/multipage/custom-elements.html#dom-window-customelements |
| DevicePixelRatio | Gets the number of device pixels per CSS pixel (https://drafts.csswg.org/cssom-view/#dom-window-devicepixelratio): ViewportOptions.DevicePixelRatio. |
| Document | https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window |
| Event | https://dom.spec.whatwg.org/#dom-window-event: the event being dispatched to a listener whose callback's global object is this window. |
| External | https://html.spec.whatwg.org/multipage/obsolete.html#dom-external: the obsolete External object. |
| FrameElement | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-frameelement |
| History | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history: the history object of the associated document. |
| InnerHeight | Gets the height of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerheight): ViewportOptions.Height, or the height of the iframe. |
| InnerWidth | Gets the width of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-innerwidth): ViewportOptions.Width, or the width of the iframe. |
| IsSecureContext | https://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext |
| Length | The number of document-tree child navigables (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-length). |
| LocalStorage | 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. |
| Location | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location |
| LocationBar | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-locationbar: the location bar BarProp object of the window. |
| MenuBar | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-menubar: the menu bar BarProp object of the window. |
| Name | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-name |
| Navigation | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation |
| Navigator | https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator |
| OnAbort | Gets or sets the event handler of the abort event (the onabort event handler attribute). |
| OnAfterPrint | Gets or sets the event handler of the afterprint event (the onafterprint event handler attribute). |
| OnAnimationCancel | Gets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute). |
| OnAnimationEnd | Gets or sets the event handler of the animationend event (the onanimationend event handler attribute). |
| OnAnimationIteration | Gets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute). |
| OnAnimationStart | Gets or sets the event handler of the animationstart event (the onanimationstart event handler attribute). |
| OnAuxClick | Gets or sets the event handler of the auxclick event (the onauxclick event handler attribute). |
| OnBeforeInput | Gets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute). |
| OnBeforeMatch | Gets or sets the event handler of the beforematch event (the onbeforematch event handler attribute). |
| OnBeforePrint | Gets or sets the event handler of the beforeprint event (the onbeforeprint event handler attribute). |
| OnBeforeToggle | Gets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute). |
| OnBeforeUnload | Gets or sets the event handler of the beforeunload event (the onbeforeunload event handler attribute). |
| OnBlur | Gets or sets the event handler of the blur event (the onblur event handler attribute). |
| OnCanPlay | Gets or sets the event handler of the canplay event (the oncanplay event handler attribute). |
| OnCanPlayThrough | Gets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute). |
| OnCancel | Gets or sets the event handler of the cancel event (the oncancel event handler attribute). |
| OnChange | Gets or sets the event handler of the change event (the onchange event handler attribute). |
| OnClick | Gets or sets the event handler of the click event (the onclick event handler attribute). |
| OnClose | Gets or sets the event handler of the close event (the onclose event handler attribute). |
| OnCommand | Gets or sets the event handler of the command event (the oncommand event handler attribute). |
| OnContentVisibilityAutoStateChange | Gets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute). |
| OnContextMenu | Gets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute). |
| OnContextRestored | Gets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute). |
| OnContextlost | Gets or sets the event handler of the contextlost event (the oncontextlost event handler attribute). |
| OnCopy | Gets or sets the event handler of the copy event (the oncopy event handler attribute). |
| OnCueChange | Gets or sets the event handler of the cuechange event (the oncuechange event handler attribute). |
| OnCut | Gets or sets the event handler of the cut event (the oncut event handler attribute). |
| OnDblClick | Gets or sets the event handler of the dblclick event (the ondblclick event handler attribute). |
| OnDeviceMotion | Gets or sets the event handler of the devicemotion event. |
| OnDeviceOrientation | Gets or sets the event handler of the deviceorientation event. |
| OnDeviceOrientationAbsolute | Gets or sets the event handler of the deviceorientationabsolute event. |
| OnDrag | Gets or sets the event handler of the drag event (the ondrag event handler attribute). |
| OnDragEnd | Gets or sets the event handler of the dragend event (the ondragend event handler attribute). |
| OnDragEnter | Gets or sets the event handler of the dragenter event (the ondragenter event handler attribute). |
| OnDragLeave | Gets or sets the event handler of the dragleave event (the ondragleave event handler attribute). |
| OnDragOver | Gets or sets the event handler of the dragover event (the ondragover event handler attribute). |
| OnDragStart | Gets or sets the event handler of the dragstart event (the ondragstart event handler attribute). |
| OnDrop | Gets or sets the event handler of the drop event (the ondrop event handler attribute). |
| OnDurationChange | Gets or sets the event handler of the durationchange event (the ondurationchange event handler attribute). |
| OnEmptied | Gets or sets the event handler of the emptied event (the onemptied event handler attribute). |
| OnEnded | Gets or sets the event handler of the ended event (the onended event handler attribute). |
| OnError | Gets or sets the event handler of the error event (the onerror event handler attribute). |
| OnFocus | Gets or sets the event handler of the focus event (the onfocus event handler attribute). |
| OnFormData | Gets or sets the event handler of the formdata event (the onformdata event handler attribute). |
| OnGotPointerCapture | Gets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute). |
| OnHashChange | Gets or sets the event handler of the hashchange event (the onhashchange event handler attribute). |
| OnInput | Gets or sets the event handler of the input event (the oninput event handler attribute). |
| OnInvalid | Gets or sets the event handler of the invalid event (the oninvalid event handler attribute). |
| OnKeyDown | Gets or sets the event handler of the keydown event (the onkeydown event handler attribute). |
| OnKeyPress | Gets or sets the event handler of the keypress event (the onkeypress event handler attribute). |
| OnKeyUp | Gets or sets the event handler of the keyup event (the onkeyup event handler attribute). |
| OnLanguageChange | Gets or sets the event handler of the languagechange event (the onlanguagechange event handler attribute). |
| OnLoad | Gets or sets the event handler of the load event (the onload event handler attribute). |
| OnLoadStart | Gets or sets the event handler of the loadstart event (the onloadstart event handler attribute). |
| OnLoadedData | Gets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute). |
| OnLoadedMetadata | Gets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute). |
| OnLostPointerCapture | Gets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute). |
| OnMessage | Gets or sets the event handler of the message event (the onmessage event handler attribute). |
| OnMessageError | Gets or sets the event handler of the messageerror event (the onmessageerror event handler attribute). |
| OnMouseDown | Gets or sets the event handler of the mousedown event (the onmousedown event handler attribute). |
| OnMouseEnter | Gets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute). |
| OnMouseLeave | Gets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute). |
| OnMouseMove | Gets or sets the event handler of the mousemove event (the onmousemove event handler attribute). |
| OnMouseOut | Gets or sets the event handler of the mouseout event (the onmouseout event handler attribute). |
| OnMouseOver | Gets or sets the event handler of the mouseover event (the onmouseover event handler attribute). |
| OnMouseUp | Gets or sets the event handler of the mouseup event (the onmouseup event handler attribute). |
| OnOffline | Gets or sets the event handler of the offline event (the onoffline event handler attribute). |
| OnOnline | Gets or sets the event handler of the online event (the ononline event handler attribute). |
| OnPageHide | Gets or sets the event handler of the pagehide event (the onpagehide event handler attribute). |
| OnPageReveal | Gets or sets the event handler of the pagereveal event (the onpagereveal event handler attribute). |
| OnPageShow | Gets or sets the event handler of the pageshow event (the onpageshow event handler attribute). |
| OnPageSwap | Gets or sets the event handler of the pageswap event (the onpageswap event handler attribute). |
| OnPaste | Gets or sets the event handler of the paste event (the onpaste event handler attribute). |
| OnPause | Gets or sets the event handler of the pause event (the onpause event handler attribute). |
| OnPlay | Gets or sets the event handler of the play event (the onplay event handler attribute). |
| OnPlaying | Gets or sets the event handler of the playing event (the onplaying event handler attribute). |
| OnPointerCancel | Gets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute). |
| OnPointerDown | Gets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute). |
| OnPointerEnter | Gets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute). |
| OnPointerLeave | Gets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute). |
| OnPointerMove | Gets or sets the event handler of the pointermove event (the onpointermove event handler attribute). |
| OnPointerOut | Gets or sets the event handler of the pointerout event (the onpointerout event handler attribute). |
| OnPointerOver | Gets or sets the event handler of the pointerover event (the onpointerover event handler attribute). |
| OnPointerRawUpdate | Gets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute). |
| OnPointerUp | Gets or sets the event handler of the pointerup event (the onpointerup event handler attribute). |
| OnPopState | Gets or sets the event handler of the popstate event (the onpopstate event handler attribute). |
| OnProgress | Gets or sets the event handler of the progress event (the onprogress event handler attribute). |
| OnRateChange | Gets or sets the event handler of the ratechange event (the onratechange event handler attribute). |
| OnRejectionHandled | Gets or sets the event handler of the rejectionhandled event (the onrejectionhandled event handler attribute). |
| OnReset | Gets or sets the event handler of the reset event (the onreset event handler attribute). |
| OnResize | Gets or sets the event handler of the resize event (the onresize event handler attribute). |
| OnScroll | Gets or sets the event handler of the scroll event (the onscroll event handler attribute). |
| OnScrollEnd | Gets or sets the event handler of the scrollend event (the onscrollend event handler attribute). |
| OnScrollSnapChange | Gets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute). |
| OnScrollSnapChanging | Gets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute). |
| OnSecurityPolicyViolation | Gets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute). |
| OnSeeked | Gets or sets the event handler of the seeked event (the onseeked event handler attribute). |
| OnSeeking | Gets or sets the event handler of the seeking event (the onseeking event handler attribute). |
| OnSelect | Gets or sets the event handler of the select event (the onselect event handler attribute). |
| OnSelectStart | Gets or sets the event handler of the selectstart event (the onselectstart event handler attribute). |
| OnSelectionChange | Gets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute). |
| OnSlotChange | Gets or sets the event handler of the slotchange event (the onslotchange event handler attribute). |
| OnStalled | Gets or sets the event handler of the stalled event (the onstalled event handler attribute). |
| OnStorage | Gets or sets the event handler of the storage event (the onstorage event handler attribute). |
| OnSubmit | Gets or sets the event handler of the submit event (the onsubmit event handler attribute). |
| OnSuspend | Gets or sets the event handler of the suspend event (the onsuspend event handler attribute). |
| OnTimeUpdate | Gets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute). |
| OnToggle | Gets or sets the event handler of the toggle event (the ontoggle event handler attribute). |
| OnTransitionCancel | Gets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute). |
| OnTransitionEnd | Gets or sets the event handler of the transitionend event (the ontransitionend event handler attribute). |
| OnTransitionRun | Gets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute). |
| OnTransitionStart | Gets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute). |
| OnUnhandledRejection | Gets or sets the event handler of the unhandledrejection event (the onunhandledrejection event handler attribute). |
| OnUnload | Gets or sets the event handler of the unload event (the onunload event handler attribute). |
| OnVolumeChange | Gets or sets the event handler of the volumechange event (the onvolumechange event handler attribute). |
| OnWaiting | Gets or sets the event handler of the waiting event (the onwaiting event handler attribute). |
| OnWebkitAnimationEnd | Gets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute). |
| OnWebkitAnimationIteration | Gets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute). |
| OnWebkitAnimationStart | Gets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute). |
| OnWebkitTransitionEnd | Gets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute). |
| OnWheel | Gets or sets the event handler of the wheel event (the onwheel event handler attribute). |
| Opener | 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. |
| Origin | https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin |
| OriginAgentCluster | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-originagentcluster: whether the agent cluster of the window is origin-keyed. |
| OuterHeight | Gets the height of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerheight): see Window.OuterWidth. |
| OuterWidth | 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. |
| Parent | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-parent |
| PersonalBar | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-personalbar: the personal bar BarProp object of the window. |
| Screen | Gets the screen of the window (https://drafts.csswg.org/cssom-view/#dom-window-screen). |
| ScreenX | 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. |
| ScreenY | Gets the vertical position of the client window on the screen (https://drafts.csswg.org/cssom-view/#dom-window-screeny): see Window.ScreenX. |
| ScrollBars | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-scrollbars: the scrollbar BarProp object of the window. |
| ScrollX | 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. |
| ScrollY | Gets the vertical scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrolly): see Window.ScrollX. |
| Self | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window |
| SessionStorage | 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. |
| Status | The status bar text: the last value it was set to (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-status). |
| StatusBar | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-statusbar: the status bar BarProp object of the window. |
| ToolBar | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-toolbar: the toolbar BarProp object of the window. |
| Top | https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-top |
| TrustedTypes | https://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes |
| Viewport | Gets the viewport of the window (https://drafts.csswg.org/css-viewport/#dom-window-viewport). |
| VisualViewport | 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. |
BrowsingContext
Window.csThe 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
Closed
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-closed
public bool Closed { get; }Property value
See also
CookieStore
Window.csGets the Cookie Store API of the window (https://cookiestore.spec.whatwg.org/#dom-window-cookiestore).
public CookieStore CookieStore { get; }Credentialless
Window.cshttps://wicg.github.io/anonymous-iframe/#dom-window-credentialless: whether the document is loaded in a credentialless iframe.
public bool Credentialless { get; }CrossOriginIsolated
Window.cshttps://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; }Property value
See also
CustomElements
Window.cshttps://html.spec.whatwg.org/multipage/custom-elements.html#dom-window-customelements
public CustomElementRegistry CustomElements { get; }DevicePixelRatio
CssomView.csGets 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.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-document-window
public Document Document { get; }Property value
See also
Event
Window.cshttps://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.csFrameElement
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-frameelement
public Element? FrameElement { get; }Property value
See also
History
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-history: the history object of the associated document.
public History History { get; }Property value
See also
InnerHeight
CssomView.csGets 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.csGets 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.cshttps://html.spec.whatwg.org/multipage/webappapis.html#dom-issecurecontext
public override bool IsSecureContext { get; }Property value
See also
Length
Window.csThe number of document-tree child navigables (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-length).
public uint Length { get; }LocalStorage
Window.WebStorage.csGets 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; }Property value
See also
Location
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location
public Location Location { get; }Property value
See also
LocationBar
Window.csMenuBar
Window.csName
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-name
public string Name { get; set; }OnAbort
Window.g.csGets or sets the event handler of the abort event (the onabort event handler attribute).
Property value
See also
OnAfterPrint
Window.g.csGets or sets the event handler of the afterprint event (the onafterprint event handler attribute).
OnAnimationCancel
Window.g.csGets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).
OnAnimationEnd
Window.g.csGets or sets the event handler of the animationend event (the onanimationend event handler attribute).
OnAnimationIteration
Window.g.csGets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).
OnAnimationStart
Window.g.csGets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).
OnAuxClick
Window.g.csGets or sets the event handler of the auxclick event (the onauxclick event handler attribute).
Property value
See also
OnBeforeInput
Window.g.csGets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).
OnBeforeMatch
Window.g.csGets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).
OnBeforePrint
Window.g.csGets or sets the event handler of the beforeprint event (the onbeforeprint event handler attribute).
OnBeforeToggle
Window.g.csGets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).
OnBeforeUnload
Window.g.csGets or sets the event handler of the beforeunload event (the onbeforeunload event handler attribute).
OnBlur
Window.g.csGets or sets the event handler of the blur event (the onblur event handler attribute).
Property value
See also
OnCanPlay
Window.g.csGets or sets the event handler of the canplay event (the oncanplay event handler attribute).
Property value
See also
OnCanPlayThrough
Window.g.csGets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).
OnCancel
Window.g.csGets or sets the event handler of the cancel event (the oncancel event handler attribute).
Property value
See also
OnChange
Window.g.csGets or sets the event handler of the change event (the onchange event handler attribute).
Property value
See also
OnClick
Window.g.csGets or sets the event handler of the click event (the onclick event handler attribute).
Property value
See also
OnClose
Window.g.csGets or sets the event handler of the close event (the onclose event handler attribute).
Property value
See also
OnCommand
Window.g.csGets or sets the event handler of the command event (the oncommand event handler attribute).
Property value
See also
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.csGets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).
OnContextRestored
Window.g.csGets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).
OnContextlost
Window.g.csGets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).
OnCopy
Window.g.csGets or sets the event handler of the copy event (the oncopy event handler attribute).
Property value
See also
OnCueChange
Window.g.csGets or sets the event handler of the cuechange event (the oncuechange event handler attribute).
Property value
See also
OnCut
Window.g.csGets or sets the event handler of the cut event (the oncut event handler attribute).
Property value
See also
OnDblClick
Window.g.csGets or sets the event handler of the dblclick event (the ondblclick event handler attribute).
Property value
See also
OnDeviceMotion
DeviceOrientationEvents.csGets or sets the event handler of the devicemotion event.
Property value
See also
OnDeviceOrientation
DeviceOrientationEvents.csGets or sets the event handler of the deviceorientation event.
Property value
See also
OnDeviceOrientationAbsolute
DeviceOrientationEvents.csGets or sets the event handler of the deviceorientationabsolute event.
OnDrag
Window.g.csGets or sets the event handler of the drag event (the ondrag event handler attribute).
Property value
See also
OnDragEnd
Window.g.csGets or sets the event handler of the dragend event (the ondragend event handler attribute).
Property value
See also
OnDragEnter
Window.g.csGets or sets the event handler of the dragenter event (the ondragenter event handler attribute).
Property value
See also
OnDragLeave
Window.g.csGets or sets the event handler of the dragleave event (the ondragleave event handler attribute).
Property value
See also
OnDragOver
Window.g.csGets or sets the event handler of the dragover event (the ondragover event handler attribute).
Property value
See also
OnDragStart
Window.g.csGets or sets the event handler of the dragstart event (the ondragstart event handler attribute).
Property value
See also
OnDrop
Window.g.csGets or sets the event handler of the drop event (the ondrop event handler attribute).
Property value
See also
OnDurationChange
Window.g.csGets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).
OnEmptied
Window.g.csGets or sets the event handler of the emptied event (the onemptied event handler attribute).
Property value
See also
OnEnded
Window.g.csGets or sets the event handler of the ended event (the onended event handler attribute).
Property value
See also
OnError
Window.g.csGets or sets the event handler of the error event (the onerror event handler attribute).
Property value
See also
OnFocus
Window.g.csGets or sets the event handler of the focus event (the onfocus event handler attribute).
Property value
See also
OnFormData
Window.g.csGets or sets the event handler of the formdata event (the onformdata event handler attribute).
Property value
See also
OnGotPointerCapture
Window.g.csGets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).
OnHashChange
Window.g.csGets or sets the event handler of the hashchange event (the onhashchange event handler attribute).
OnInput
Window.g.csGets or sets the event handler of the input event (the oninput event handler attribute).
Property value
See also
OnInvalid
Window.g.csGets or sets the event handler of the invalid event (the oninvalid event handler attribute).
Property value
See also
OnKeyDown
Window.g.csGets or sets the event handler of the keydown event (the onkeydown event handler attribute).
Property value
See also
OnKeyPress
Window.g.csGets or sets the event handler of the keypress event (the onkeypress event handler attribute).
Property value
See also
OnKeyUp
Window.g.csGets or sets the event handler of the keyup event (the onkeyup event handler attribute).
Property value
See also
OnLanguageChange
Window.g.csGets or sets the event handler of the languagechange event (the onlanguagechange event handler attribute).
OnLoad
Window.g.csGets or sets the event handler of the load event (the onload event handler attribute).
Property value
See also
OnLoadStart
Window.g.csGets or sets the event handler of the loadstart event (the onloadstart event handler attribute).
Property value
See also
OnLoadedData
Window.g.csGets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).
OnLoadedMetadata
Window.g.csGets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).
OnLostPointerCapture
Window.g.csGets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).
OnMessage
Window.g.csGets or sets the event handler of the message event (the onmessage event handler attribute).
OnMessageError
Window.g.csGets or sets the event handler of the messageerror event (the onmessageerror event handler attribute).
OnMouseDown
Window.g.csGets or sets the event handler of the mousedown event (the onmousedown event handler attribute).
Property value
See also
OnMouseEnter
Window.g.csGets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).
OnMouseLeave
Window.g.csGets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).
OnMouseMove
Window.g.csGets or sets the event handler of the mousemove event (the onmousemove event handler attribute).
Property value
See also
OnMouseOut
Window.g.csGets or sets the event handler of the mouseout event (the onmouseout event handler attribute).
Property value
See also
OnMouseOver
Window.g.csGets or sets the event handler of the mouseover event (the onmouseover event handler attribute).
Property value
See also
OnMouseUp
Window.g.csGets or sets the event handler of the mouseup event (the onmouseup event handler attribute).
Property value
See also
OnOffline
Window.g.csGets or sets the event handler of the offline event (the onoffline event handler attribute).
OnOnline
Window.g.csGets or sets the event handler of the online event (the ononline event handler attribute).
OnPageHide
Window.g.csGets or sets the event handler of the pagehide event (the onpagehide event handler attribute).
OnPageReveal
Window.g.csGets or sets the event handler of the pagereveal event (the onpagereveal event handler attribute).
OnPageShow
Window.g.csGets or sets the event handler of the pageshow event (the onpageshow event handler attribute).
OnPageSwap
Window.g.csGets or sets the event handler of the pageswap event (the onpageswap event handler attribute).
OnPaste
Window.g.csGets or sets the event handler of the paste event (the onpaste event handler attribute).
Property value
See also
OnPause
Window.g.csGets or sets the event handler of the pause event (the onpause event handler attribute).
Property value
See also
OnPlay
Window.g.csGets or sets the event handler of the play event (the onplay event handler attribute).
Property value
See also
OnPlaying
Window.g.csGets or sets the event handler of the playing event (the onplaying event handler attribute).
Property value
See also
OnPointerCancel
Window.g.csGets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).
OnPointerDown
Window.g.csGets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).
Property value
See also
OnPointerEnter
Window.g.csGets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).
OnPointerLeave
Window.g.csGets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).
OnPointerMove
Window.g.csGets or sets the event handler of the pointermove event (the onpointermove event handler attribute).
Property value
See also
OnPointerOut
Window.g.csGets or sets the event handler of the pointerout event (the onpointerout event handler attribute).
Property value
See also
OnPointerOver
Window.g.csGets or sets the event handler of the pointerover event (the onpointerover event handler attribute).
Property value
See also
OnPointerRawUpdate
Window.g.csGets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).
OnPointerUp
Window.g.csGets or sets the event handler of the pointerup event (the onpointerup event handler attribute).
Property value
See also
OnPopState
Window.g.csGets or sets the event handler of the popstate event (the onpopstate event handler attribute).
OnProgress
Window.g.csGets or sets the event handler of the progress event (the onprogress event handler attribute).
Property value
See also
OnRateChange
Window.g.csGets or sets the event handler of the ratechange event (the onratechange event handler attribute).
OnRejectionHandled
Window.g.csGets or sets the event handler of the rejectionhandled event (the onrejectionhandled event handler attribute).
OnReset
Window.g.csGets or sets the event handler of the reset event (the onreset event handler attribute).
Property value
See also
OnResize
Window.g.csGets or sets the event handler of the resize event (the onresize event handler attribute).
Property value
See also
OnScroll
Window.g.csGets or sets the event handler of the scroll event (the onscroll event handler attribute).
Property value
See also
OnScrollEnd
Window.g.csGets or sets the event handler of the scrollend event (the onscrollend event handler attribute).
Property value
See also
OnScrollSnapChange
Window.g.csGets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).
OnScrollSnapChanging
Window.g.csGets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).
OnSecurityPolicyViolation
Window.g.csGets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).
OnSeeked
Window.g.csGets or sets the event handler of the seeked event (the onseeked event handler attribute).
Property value
See also
OnSeeking
Window.g.csGets or sets the event handler of the seeking event (the onseeking event handler attribute).
Property value
See also
OnSelect
Window.g.csGets or sets the event handler of the select event (the onselect event handler attribute).
Property value
See also
OnSelectStart
Window.g.csGets or sets the event handler of the selectstart event (the onselectstart event handler attribute).
Property value
See also
OnSelectionChange
Window.g.csGets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).
OnSlotChange
Window.g.csGets or sets the event handler of the slotchange event (the onslotchange event handler attribute).
OnStalled
Window.g.csGets or sets the event handler of the stalled event (the onstalled event handler attribute).
Property value
See also
OnStorage
Window.g.csGets or sets the event handler of the storage event (the onstorage event handler attribute).
OnSubmit
Window.g.csGets or sets the event handler of the submit event (the onsubmit event handler attribute).
Property value
See also
OnSuspend
Window.g.csGets or sets the event handler of the suspend event (the onsuspend event handler attribute).
Property value
See also
OnTimeUpdate
Window.g.csGets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).
OnToggle
Window.g.csGets or sets the event handler of the toggle event (the ontoggle event handler attribute).
Property value
See also
OnTransitionCancel
Window.g.csGets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).
OnTransitionEnd
Window.g.csGets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).
OnTransitionRun
Window.g.csGets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).
OnTransitionStart
Window.g.csGets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).
OnUnhandledRejection
Window.g.csGets or sets the event handler of the unhandledrejection event (the onunhandledrejection event handler attribute).
OnUnload
Window.g.csGets or sets the event handler of the unload event (the onunload event handler attribute).
OnVolumeChange
Window.g.csGets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).
OnWaiting
Window.g.csGets or sets the event handler of the waiting event (the onwaiting event handler attribute).
Property value
See also
OnWebkitAnimationEnd
Window.g.csGets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).
OnWebkitAnimationIteration
Window.g.csGets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).
OnWebkitAnimationStart
Window.g.csGets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).
OnWebkitTransitionEnd
Window.g.csGets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).
OnWheel
Window.g.csGets or sets the event handler of the wheel event (the onwheel event handler attribute).
Property value
See also
Opener
Window.cshttps://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; }Property value
See also
Origin
Window.cshttps://html.spec.whatwg.org/multipage/webappapis.html#dom-origin
public override string Origin { get; }OriginAgentCluster
Window.cshttps://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; }Property value
See also
OuterHeight
CssomView.Scrolling.csGets the height of the client window (https://drafts.csswg.org/cssom-view/#dom-window-outerheight): see Window.OuterWidth.
public int OuterHeight { get; }OuterWidth
CssomView.Scrolling.csGets 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.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-parent
public Window? Parent { get; }Property value
See also
PersonalBar
Window.csScreen
CssomView.csGets the screen of the window (https://drafts.csswg.org/cssom-view/#dom-window-screen).
public Screen Screen { get; }ScreenX
CssomView.Scrolling.csGets 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; }ScreenY
CssomView.Scrolling.csGets 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.csScrollX
CssomView.Scrolling.csGets 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; }ScrollY
CssomView.Scrolling.csGets the vertical scroll position of the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrolly): see Window.ScrollX.
public double ScrollY { get; }Self
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window
public Window Self { get; }SessionStorage
Window.WebStorage.csGets 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; }Property value
See also
Status
Window.csThe 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.csToolBar
Window.csTop
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-top
public Window? Top { get; }TrustedTypes
TrustedTypesGlobals.cshttps://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes
public TrustedTypePolicyFactory TrustedTypes { get; }Viewport
Viewport.csGets the viewport of the window (https://drafts.csswg.org/css-viewport/#dom-window-viewport).
public Viewport Viewport { get; }VisualViewport
CssomView.Scrolling.csGets 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
| Name | Description |
|---|---|
| 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.csReturns 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.
Methods
| Name | Description |
|---|---|
| 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.cshttps://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.cshttps://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert: shows the message with BrowsingContextOptions.UserPromptHandler (without handler, it does nothing).
Blur()
Window.cshttps://html.spec.whatwg.org/multipage/interaction.html#dom-window-blur: does nothing.
public void Blur()CancelAnimationFrame(uint)
Window.Timers.cshttps://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animationframeprovider-cancelanimationframe
CancelIdleCallback(uint)
Window.IdleCallbacks.csCancels an idle callback (https://w3c.github.io/requestidlecallback/#the-cancelidlecallback-method). Does nothing when the handle is unknown.
CaptureEvents()
Window.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-window-captureevents: does nothing.
public void CaptureEvents()Close()
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-close
public void Close()Confirm(string)
Window.cshttps://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()
Window.cshttps://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.csReturns 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
Returns
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.csReturns 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()
Selection.csReturns the selection associated with the document of the window.
public Selection? GetSelection()MatchMedia(string)
CssomView.csReturns 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.csMoveTo(int, int)
CssomView.Scrolling.csOpen(string, string, string)
Window.csThe 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.
Parameters
urlstring- The URL to load, relative to the document of the window; the empty string keeps the initial about:blank document.
targetstring- The target name (
_blankwhen empty). featuresstring- The window features:
noopenerandnoreferrer, 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,topand their aliases).
Returns
Window? The window of the target navigable, or null (noopener, noreferrer, or no navigable).
Exceptions
DomException- A
SyntaxErrorwhen the URL cannot be parsed.
See also
PostMessage overloads
PostMessage(object?, WindowPostMessageOptions?)
Window.Messaging.csPosts 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
messageobject?- The message: a value of the script engine, a .NET primitive value or a serializable platform object, or null for
undefined. optionsWindowPostMessageOptions?- The target origin (
/by default) and the objects to transfer.
Exceptions
DomException- A
SyntaxErrorwhen the target origin is not a valid URL, or aDataCloneErrorwhen the message cannot be serialized.
See also
PostMessage(object?, string, IReadOnlyList<object>?)
Window.Messaging.csPosts 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
messageobject?- The message: a value of the script engine, a .NET primitive value or a serializable platform object, or null for
undefined. targetOriginstring- 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). transferIReadOnlyList<object>?- The objects to transfer (the
ArrayBufferobjects of the script engine, and the message ports).
Exceptions
DomException- A
SyntaxErrorwhentargetOriginis not a valid URL, or aDataCloneErrorwhen the message cannot be serialized.
See also
Print()
Window.cshttps://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.cshttps://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).
Parameters
Returns
See also
ReleaseEvents()
Window.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-window-releaseevents: does nothing.
public void ReleaseEvents()RequestAnimationFrame(FrameRequestCallback)
Window.Timers.cshttps://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.csRequests 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
callbackIdleRequestCallback- The callback.
optionsIdleRequestOptions?- The timeout of the callback, or null.
Returns
uint The handle of the callback, for Window.CancelIdleCallback.
See also
RequestResize()
ResponsiveEmbeddedSizing.cshttps://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.csResizeTo(int, int)
CssomView.Scrolling.csScroll overloads
Scroll(ScrollToOptions?)
CssomView.Scrolling.csScrolls 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.csScrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scroll): see Window.Scroll.
ScrollBy overloads
ScrollBy(ScrollToOptions?)
CssomView.Scrolling.csScrolls 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.csScrolls the viewport by an offset (https://drafts.csswg.org/cssom-view/#dom-window-scrollby): see Window.ScrollBy.
Parameters
Returns
See also
ScrollTo overloads
ScrollTo(ScrollToOptions?)
CssomView.Scrolling.csScrolls 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.csScrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-window-scrollto): see Window.Scroll.
Parameters
Returns
See also
Stop()
Window.cshttps://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-stop: aborts the ongoing navigation.
public void Stop()