Interface IWindow
Namespace: Aspose.Html.Window
Assembly: Aspose.HTML.dll (25.2.0)
The window object represents a window containing a DOM document.
[ComVisible(true)]
[DOMNoInterfaceObject]
public interface IWindow : IEventTarget, IGlobalEventHandlers, IWindowEventHandlers, IWindowTimers, IDocumentView, IAbstractView, IDisposable
Implements
IEventTarget, IGlobalEventHandlers, IWindowEventHandlers, IWindowTimers, IDocumentView, IAbstractView, IDisposable
Properties
Document
The document attribute must return the Window object’s newest Document object.
[DOMName("document")]
Document Document { get; }
Property Value
FrameElement
The frameElement object of a Document.
[DOMName("frameElement")]
Element FrameElement { get; }
Property Value
LocalStorage
Returns a Storage object that allows you to save key/value pairs in the user agent.
[DOMName("localStorage")]
IStorage LocalStorage { get; }
Property Value
Location
The location attribute of the Window interface must return the Location object for that Window object’s Document.
[DOMName("location")]
Location Location { get; }
Property Value
Name
The name attribute of the Window object must, on getting, return the current name of the browsing context, and, on setting, set the name of the browsing context to the new value.
[DOMName("name")]
string Name { get; set; }
Property Value
Opener
The opener IDL attribute on the Window object, on getting, must return the WindowProxy object of the browsing context from which the current browsing context was created (its opener browsing context), if there is one, if it is still available, and if the current browsing context has not disowned its opener; otherwise, it must return null. On setting, if the new value is null then the current browsing context must disown its opener; if the new value is anything else then the user agent must call the [[DefineOwnProperty]] internal method of the Window object, passing the property name “opener” as the property key, and the Property Descriptor { [[Value]]: value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true } as the property descriptor, where value is the new value.
[DOMName("opener")]
IWindow Opener { get; }
Property Value
Parent
The parent IDL attribute on the Window object of a Document in a browsing context b must return the WindowProxy object of the parent browsing context, if there is one (i.e. if b is a child browsing context), or the WindowProxy object of the browsing context b itself, otherwise (i.e. if it is a top-level browsing context or a detached nested browsing context).
[DOMName("parent")]
IWindow Parent { get; }
Property Value
Self
Returns the Window object’s browsing context’s WindowProxy object.
[DOMName("self")]
IWindow Self { get; }
Property Value
Top
The top IDL attribute on the Window object of a Document in a browsing context b must return the WindowProxy object of its top-level browsing context (which would be its own WindowProxy object if it was a top-level browsing context itself), if it has one, or its own WindowProxy object otherwise (e.g. if it was a detached nested browsing context).
[DOMName("top")]
IWindow Top { get; }
Property Value
Window
Returns the Window object’s browsing context’s WindowProxy object.
[DOMName("window")]
IWindow Window { get; }
Property Value
Methods
Alert(string)
Displays a modal alert with the given message, and waits for the user to dismiss it
[DOMName("alert")]
void Alert(string message)
Parameters
message
string
The message.
Atob(string)
Takes the input data, in the form of a Unicode string containing base64-encoded binary data, decodes it, and returns a string consisting of characters in the range U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF respectively, corresponding to that binary data.
[DOMName("atob")]
string Atob(string data)
Parameters
data
string
The Unicode string containing base64-encoded binary data
Returns
The string consisting of characters in the range U+0000 to U+00FF
Exceptions
Throws an “InvalidCharacterError” DOMException if the input string is not valid base64 data.
Btoa(string)
Takes the input data, in the form of a Unicode string containing only characters in the range U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF respectively, and converts it to its base64 representation, which it returns.
[DOMName("btoa")]
string Btoa(string data)
Parameters
data
string
The Unicode string containing only characters in the range U+0000 to U+00FF.
Returns
The base64 string.
Exceptions
Throws an “InvalidCharacterError” DOMException exception if the input string contains any out-of-range characters.
Confirm(string)
Displays a modal OK/Cancel prompt with the given message, waits for the user to dismiss it, and returns true if the user clicks OK and false if the user clicks Cancel.
[DOMName("confirm")]
bool Confirm(string message)
Parameters
message
string
The message.
Returns
Returns true if the user clicks OK and false if the user clicks Cancel
MatchMedia(string)
Returns a new MediaQueryList object that can then be used to determine if the document matches the media query string, as well as to monitor the document to detect when it matches (or stops matching) that media query. See CSSOM View Module specification: https://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface
[DOMName("matchMedia")]
MediaQueryList MatchMedia(string query)
Parameters
query
string
The string containing a media query; see https://drafts.csswg.org/mediaqueries/ for details.
Returns
MediaQueryList object
Prompt(string, string)
Displays a modal text field prompt with the given message, waits for the user to dismiss it, and returns the value that the user entered. If the user cancels the prompt, then returns null instead. If the second argument is present, then the given value is used as a default.
[DOMName("prompt")]
string Prompt(string message, string @default)
Parameters
message
string
The message.
default
string
The default.
Returns
Returns the value that the user entered