ProtocolHandlerRegistry Class

The protocol handlers registered by the pages (https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers). It is thread-safe.

public sealed class ProtocolHandlerRegistry

Constructors

NameDescription
ProtocolHandlerRegistry()

ProtocolHandlerRegistry()

ProtocolHandlers.cs
public ProtocolHandlerRegistry()

No documentation is available.

Properties

NameDescription
HandlersGets the registered handlers (the scheme and the URL of each handler), in the order of their registration.

Gets the registered handlers (the scheme and the URL of each handler), in the order of their registration.

public IReadOnlyList<KeyValuePair<string, string>> Handlers { get; }

Methods

NameDescription
GetHandler(string)Returns the URL of the handler used for a scheme (the last registered one), or null.
Register(string, string)Registers a handler for a scheme. A scheme can have several handlers: the last registered one is used.
Unregister(string, string)Removes the handler of a scheme registered with a URL. Returns false when there is none.

GetHandler(string)

ProtocolHandlers.cs

Returns the URL of the handler used for a scheme (the last registered one), or null.

public string? GetHandler(string scheme)

Parameters

scheme string
The scheme.

Returns

string?

Register(string, string)

ProtocolHandlers.cs

Registers a handler for a scheme. A scheme can have several handlers: the last registered one is used.

public void Register(string scheme, string url)

Parameters

scheme string
The scheme (e.g. mailto or web+soup).
url string
The URL of the handler, in which the first %s is replaced with the URL to handle.

Unregister(string, string)

ProtocolHandlers.cs

Removes the handler of a scheme registered with a URL. Returns false when there is none.

public bool Unregister(string scheme, string url)

Parameters

scheme string
The scheme.
url string
The URL of the handler.

Returns

bool