Interface IWindow
- Namespace
- AngleSharp.Dom
- Assembly
- AngleSharp.dll
The interface for a browsing window element. https://developer.mozilla.org/en-US/docs/Web/API/Window
[DomName("Window")]
public interface IWindow : IEventTarget, IGlobalEventHandlers, IWindowEventHandlers, IWindowTimers, IDisposable
- Inherited Members
- Extension Methods
Properties
Document
Gets a reference to the document that the window contains.
[DomName("document")]
IDocument Document { get; }
Property Value
History
Gets the history of the current window.
[DomName("history")]
IHistory? History { get; }
Property Value
IsClosed
Gets if the window has been closed.
[DomName("closed")]
bool IsClosed { get; }
Property Value
Location
Gets the location of the current document.
[DomName("location")]
[DomPutForwards("href")]
ILocation Location { get; }
Property Value
Name
Gets or sets the name of the window.
[DomName("name")]
string? Name { get; set; }
Property Value
Navigator
Gets the user-agent information.
[DomName("navigator")]
INavigator? Navigator { get; }
Property Value
OuterHeight
Gets the height of the outside of the browser window.
[DomName("outerHeight")]
int OuterHeight { get; }
Property Value
OuterWidth
Gets the width of the outside of the browser window.
[DomName("outerWidth")]
int OuterWidth { get; }
Property Value
Proxy
Gets the proxy to the current browsing context.
[DomName("window")]
[DomName("frames")]
[DomName("self")]
IWindow? Proxy { get; }
Property Value
ScreenX
Gets the horizontal distance of the left border of the user's browser from the left side of the screen.
[DomName("screenX")]
int ScreenX { get; }
Property Value
ScreenY
Gets the vertical distance of the top border of the user's browser from the top side of the screen.
[DomName("screenY")]
int ScreenY { get; }
Property Value
Status
Gets or sets the status of the window.
[DomName("status")]
string? Status { get; set; }
Property Value
Methods
Alert(string)
Shows the messagebox with the given message.
[DomName("alert")]
void Alert(string message)
Parameters
message
stringThe message to display.
Blur()
Removes the focus from the current window.
[DomName("blur")]
void Blur()
Close()
Closes the window.
[DomName("close")]
void Close()
Confirm(string)
Opens a confirmation box with the provided message.
[DomName("confirm")]
bool Confirm(string message)
Parameters
message
stringThe message to display.
Returns
- bool
True if the message has been confirmed, otherwise false.
Focus()
Focuses the current window.
[DomName("focus")]
void Focus()
Open(string, string?, string?, string?)
Opens a window to show url, and returns it. If a window exists with the provided name already, it is reused.
IWindow Open(string url = "about:blank", string? name = null, string? features = null, string? replace = null)
Parameters
url
stringThe URL to open initially.
name
stringThe name of the new window.
features
stringDetermines the rendering of the new window.
replace
stringCan be used to remove whatever page is currently open from the session history.
Returns
- IWindow
The new or reused window.
Print()
Opens the print dialog for the current window.
[DomName("print")]
void Print()
Stop()
Stops the current document from being loaded.
[DomName("stop")]
void Stop()