ApiExtensions
A set of useful extension methods when dealing with the DOM.
Gets the ancestor nodes of the given child.
public static Task<Event> AwaitEvent<TEventTarget>(this TEventTarget node, string eventName) where TEventTarget : IEventTarget
Returns a task that is completed once the event is fired.
Creates an element of the given type or returns null, if there is
no such type.
Gets the descendent nodes of the given parent.
Uses the URL to download the content, parse it as CSS and returning
a new CSSStyleSheet with the CSS-OM representation.
Uses the URL to download the content asynchronously, parse it as CSS and returning
a new CSSStyleSheet with the CSS-OM representation.
public static Task<ICssStyleSheet> GetCssAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null)
Uses the URL to download the content asynchronously, parse it as CSS and returning
a new CSSStyleSheet with the CSS-OM representation.
Uses the URL to download the content, parse it as HTML and returning
a new HTMLDocument with the DOM representation.
Uses the URL to download the content asynchronously, parse it as HTML and returning
a new HTMLDocument with the DOM representation.
public static Task<IDocument> GetHtmlAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null)
Uses the URL to download the content asynchronously, parse it as HTML and returning
a new HTMLDocument with the DOM representation.
Interprets the string as CSS source code and returns new CSSStyleSheet
with the CSS-OM representation.
Interprets the string as HTML source code and returns new HTMLDocument
with the DOM representation.