Contents

URLSchemeHandler

A protocol for loading resources with URL schemes that WebKit doesn’t handle.

Declaration

protocol URLSchemeHandler

Overview

Adopt the URLSchemeHandler protocol in types that handle custom URL schemes for your web content. Custom schemes let you integrate custom resource types into your web content, and you may define custom schemes for resources that your app requires. For example, you might use a custom scheme to integrate content that is available only on the user’s device, such as the user’s photos. These types can then be registered to a particular WebPage by using the urlSchemeHandlers property of WebPage.Configuration.

When a web page encounters a resource that uses a custom scheme, it passes the URLRequest to the scheme handler, and expects a stream of responses and data to load the result.

If WebKit determines that it no longer needs a resource that your handler is loading, it will cancel the Task responsible for the async sequence. Typically, this may happen when the user navigates to another page, but may happen for other reasons.

Topics

Associated Types

Instance Methods

See Also

Configuring a WebPage