pub unsafe trait WKURLSchemeHandler: NSObjectProtocol + MainThreadOnly {
// Provided methods
unsafe fn webView_startURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
where Self: Sized + Message { ... }
unsafe fn webView_stopURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
where Self: Sized + Message { ... }
}
WKURLSchemeHandler
only.Expand description
A class conforming to the WKURLSchemeHandler protocol provides methods for loading resources with URL schemes that WebKit doesn’t know how to handle itself.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn webView_startURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
Available on crate feature WKURLSchemeTask
and crate feature WKWebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_startURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
WKURLSchemeTask
and crate feature WKWebView
and crate feature objc2-app-kit
and macOS only.Notifies your app to start loading the data for a particular resource represented by the URL scheme handler task.
Parameter webView
: The web view invoking the method.
Parameter urlSchemeTask
: The task that your app should start loading data for.
Sourceunsafe fn webView_stopURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
Available on crate feature WKURLSchemeTask
and crate feature WKWebView
and crate feature objc2-app-kit
and macOS only.
unsafe fn webView_stopURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
WKURLSchemeTask
and crate feature WKWebView
and crate feature objc2-app-kit
and macOS only.Notifies your app to stop handling a URL scheme handler task.
Parameter webView
: The web view invoking the method.
Parameter urlSchemeTask
: The task that your app should stop handling.
After your app is told to stop loading data for a URL scheme handler task it must not perform any callbacks for that task. An exception will be thrown if any callbacks are made on the URL scheme handler task after your app has been told to stop loading for it.