Package apple.webkit.protocol
Interface WKNavigationDelegate
-
public interface WKNavigationDelegateA class conforming to the WKNavigationDelegate protocol can provide methods for tracking progress for main frame navigations and for deciding policy for main frame and subframe navigations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceWKNavigationDelegate.Block_webViewAuthenticationChallengeShouldAllowDeprecatedTLSstatic interfaceWKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionDecisionHandlerstatic interfaceWKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionPreferencesDecisionHandlerstatic interfaceWKNavigationDelegate.Block_webViewDecidePolicyForNavigationResponseDecisionHandlerstatic interfaceWKNavigationDelegate.Block_webViewDidReceiveAuthenticationChallengeCompletionHandler
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidwebViewAuthenticationChallengeShouldAllowDeprecatedTLS(@NotNull WKWebView webView, @NotNull NSURLAuthenticationChallenge challenge, @NotNull WKNavigationDelegate.Block_webViewAuthenticationChallengeShouldAllowDeprecatedTLS decisionHandler)Invoked when the web view is establishing a network connection using a deprecated version of TLS.default voidwebViewDecidePolicyForNavigationActionDecisionHandler(@NotNull WKWebView webView, @NotNull WKNavigationAction navigationAction, @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation.default voidwebViewDecidePolicyForNavigationActionPreferencesDecisionHandler(@NotNull WKWebView webView, @NotNull WKNavigationAction navigationAction, @NotNull WKWebpagePreferences preferences, @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionPreferencesDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation.default voidwebViewDecidePolicyForNavigationResponseDecisionHandler(@NotNull WKWebView webView, @NotNull WKNavigationResponse navigationResponse, @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationResponseDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation after its response is known.default voidwebViewDidCommitNavigation(@NotNull WKWebView webView, WKNavigation navigation)Invoked when content starts arriving for the main frame.default voidwebViewDidFailNavigationWithError(@NotNull WKWebView webView, WKNavigation navigation, @NotNull NSError error)Invoked when an error occurs during a committed main frame navigation.default voidwebViewDidFailProvisionalNavigationWithError(@NotNull WKWebView webView, WKNavigation navigation, @NotNull NSError error)Invoked when an error occurs while starting to load data for the main frame.default voidwebViewDidFinishNavigation(@NotNull WKWebView webView, WKNavigation navigation)Invoked when a main frame navigation completes.default voidwebViewDidReceiveAuthenticationChallengeCompletionHandler(@NotNull WKWebView webView, @NotNull NSURLAuthenticationChallenge challenge, @NotNull WKNavigationDelegate.Block_webViewDidReceiveAuthenticationChallengeCompletionHandler completionHandler)Invoked when the web view needs to respond to an authentication challenge.default voidwebViewDidReceiveServerRedirectForProvisionalNavigation(@NotNull WKWebView webView, WKNavigation navigation)Invoked when a server redirect is received for the main frame.default voidwebViewDidStartProvisionalNavigation(@NotNull WKWebView webView, WKNavigation navigation)Invoked when a main frame navigation starts.default voidwebViewNavigationActionDidBecomeDownload(@NotNull WKWebView webView, @NotNull WKNavigationAction navigationAction, @NotNull WKDownload download)Called after using WKNavigationActionPolicyDownload.default voidwebViewNavigationResponseDidBecomeDownload(@NotNull WKWebView webView, @NotNull WKNavigationResponse navigationResponse, @NotNull WKDownload download)Called after using WKNavigationResponsePolicyDownload.default voidwebViewWebContentProcessDidTerminate(@NotNull WKWebView webView)Invoked when the web view's web content process is terminated.
-
-
-
Method Detail
-
webViewDecidePolicyForNavigationActionDecisionHandler
default void webViewDecidePolicyForNavigationActionDecisionHandler(@NotNull @NotNull WKWebView webView, @NotNull @NotNull WKNavigationAction navigationAction, @NotNull @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation. If you do not implement this method, the web view will load the request or, if appropriate, forward it to another application.- Parameters:
webView- The web view invoking the delegate method.navigationAction- Descriptive information about the action triggering the navigation request.decisionHandler- The decision handler to call to allow or cancel the navigation. The argument is one of the constants of the enumerated type WKNavigationActionPolicy.
-
webViewDecidePolicyForNavigationResponseDecisionHandler
default void webViewDecidePolicyForNavigationResponseDecisionHandler(@NotNull @NotNull WKWebView webView, @NotNull @NotNull WKNavigationResponse navigationResponse, @NotNull @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationResponseDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation after its response is known. If you do not implement this method, the web view will allow the response, if the web view can show it.- Parameters:
webView- The web view invoking the delegate method.navigationResponse- Descriptive information about the navigation response.decisionHandler- The decision handler to call to allow or cancel the navigation. The argument is one of the constants of the enumerated type WKNavigationResponsePolicy.
-
webViewDidCommitNavigation
default void webViewDidCommitNavigation(@NotNull @NotNull WKWebView webView, WKNavigation navigation)Invoked when content starts arriving for the main frame.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.
-
webViewDidFailNavigationWithError
default void webViewDidFailNavigationWithError(@NotNull @NotNull WKWebView webView, WKNavigation navigation, @NotNull @NotNull NSError error)Invoked when an error occurs during a committed main frame navigation.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.error- The error that occurred.
-
webViewDidFailProvisionalNavigationWithError
default void webViewDidFailProvisionalNavigationWithError(@NotNull @NotNull WKWebView webView, WKNavigation navigation, @NotNull @NotNull NSError error)Invoked when an error occurs while starting to load data for the main frame.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.error- The error that occurred.
-
webViewDidFinishNavigation
default void webViewDidFinishNavigation(@NotNull @NotNull WKWebView webView, WKNavigation navigation)Invoked when a main frame navigation completes.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.
-
webViewDidReceiveAuthenticationChallengeCompletionHandler
default void webViewDidReceiveAuthenticationChallengeCompletionHandler(@NotNull @NotNull WKWebView webView, @NotNull @NotNull NSURLAuthenticationChallenge challenge, @NotNull @NotNull WKNavigationDelegate.Block_webViewDidReceiveAuthenticationChallengeCompletionHandler completionHandler)Invoked when the web view needs to respond to an authentication challenge. If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition.- Parameters:
webView- The web view that received the authentication challenge.challenge- The authentication challenge.completionHandler- The completion handler you must invoke to respond to the challenge. The disposition argument is one of the constants of the enumerated type NSURLSessionAuthChallengeDisposition. When disposition is NSURLSessionAuthChallengeUseCredential, the credential argument is the credential to use, or nil to indicate continuing without a credential.
-
webViewDidReceiveServerRedirectForProvisionalNavigation
default void webViewDidReceiveServerRedirectForProvisionalNavigation(@NotNull @NotNull WKWebView webView, WKNavigation navigation)Invoked when a server redirect is received for the main frame.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.
-
webViewDidStartProvisionalNavigation
default void webViewDidStartProvisionalNavigation(@NotNull @NotNull WKWebView webView, WKNavigation navigation)Invoked when a main frame navigation starts.- Parameters:
webView- The web view invoking the delegate method.navigation- The navigation.
-
webViewWebContentProcessDidTerminate
default void webViewWebContentProcessDidTerminate(@NotNull @NotNull WKWebView webView)Invoked when the web view's web content process is terminated.- Parameters:
webView- The web view whose underlying web content process was terminated. API-Since: 9.0
-
webViewDecidePolicyForNavigationActionPreferencesDecisionHandler
default void webViewDecidePolicyForNavigationActionPreferencesDecisionHandler(@NotNull @NotNull WKWebView webView, @NotNull @NotNull WKNavigationAction navigationAction, @NotNull @NotNull WKWebpagePreferences preferences, @NotNull @NotNull WKNavigationDelegate.Block_webViewDecidePolicyForNavigationActionPreferencesDecisionHandler decisionHandler)Decides whether to allow or cancel a navigation. If you implement this method, -webView:decidePolicyForNavigationAction:decisionHandler: will not be called. API-Since: 13.0- Parameters:
webView- The web view invoking the delegate method.navigationAction- Descriptive information about the action triggering the navigation request.preferences- The default set of webpage preferences. This may be changed by setting defaultWebpagePreferences on WKWebViewConfiguration.decisionHandler- The policy decision handler to call to allow or cancel the navigation. The arguments are one of the constants of the enumerated type WKNavigationActionPolicy, as well as an instance of WKWebpagePreferences.
-
webViewAuthenticationChallengeShouldAllowDeprecatedTLS
default void webViewAuthenticationChallengeShouldAllowDeprecatedTLS(@NotNull @NotNull WKWebView webView, @NotNull @NotNull NSURLAuthenticationChallenge challenge, @NotNull @NotNull WKNavigationDelegate.Block_webViewAuthenticationChallengeShouldAllowDeprecatedTLS decisionHandler)Invoked when the web view is establishing a network connection using a deprecated version of TLS.- Parameters:
webView- The web view initiating the connection.challenge- The authentication challenge.decisionHandler- The decision handler you must invoke to respond to indicate whether or not to continue with the connection establishment. API-Since: 14.0
-
webViewNavigationActionDidBecomeDownload
default void webViewNavigationActionDidBecomeDownload(@NotNull @NotNull WKWebView webView, @NotNull @NotNull WKNavigationAction navigationAction, @NotNull @NotNull WKDownload download)Called after using WKNavigationActionPolicyDownload. The download needs its delegate to be set to receive updates about its progress. API-Since: 14.5- Parameters:
webView- The web view that created the download.navigationAction- The action that is being turned into a download.download- The download.
-
webViewNavigationResponseDidBecomeDownload
default void webViewNavigationResponseDidBecomeDownload(@NotNull @NotNull WKWebView webView, @NotNull @NotNull WKNavigationResponse navigationResponse, @NotNull @NotNull WKDownload download)Called after using WKNavigationResponsePolicyDownload. The download needs its delegate to be set to receive updates about its progress. API-Since: 14.5- Parameters:
webView- The web view that created the download.navigationResponse- The response that is being turned into a download.download- The download.
-
-