WebViewClient.OnSafeBrowsingHit Method

Definition

Notify the host application that a loading URL has been flagged by Safe Browsing.

[Android.Runtime.Register("onSafeBrowsingHit", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;ILandroid/webkit/SafeBrowsingResponse;)V", "GetOnSafeBrowsingHit_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_ILandroid_webkit_SafeBrowsingResponse_Handler", ApiSince=27)]
public virtual void OnSafeBrowsingHit (Android.Webkit.WebView? view, Android.Webkit.IWebResourceRequest? request, Android.Webkit.SafeBrowsingThreat threatType, Android.Webkit.SafeBrowsingResponse? callback);
[<Android.Runtime.Register("onSafeBrowsingHit", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;ILandroid/webkit/SafeBrowsingResponse;)V", "GetOnSafeBrowsingHit_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_ILandroid_webkit_SafeBrowsingResponse_Handler", ApiSince=27)>]
abstract member OnSafeBrowsingHit : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest * Android.Webkit.SafeBrowsingThreat * Android.Webkit.SafeBrowsingResponse -> unit
override this.OnSafeBrowsingHit : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest * Android.Webkit.SafeBrowsingThreat * Android.Webkit.SafeBrowsingResponse -> unit

Parameters

view
WebView

The WebView that hit the malicious resource.

request
IWebResourceRequest

Object containing the details of the request.

threatType
SafeBrowsingThreat

The reason the resource was caught by Safe Browsing, corresponding to a SAFE_BROWSING_THREAT_* value.

callback
SafeBrowsingResponse

Applications must invoke one of the callback methods.

Attributes

Remarks

Notify the host application that a loading URL has been flagged by Safe Browsing.

The application must invoke the callback to indicate the preferred response. The default behavior is to show an interstitial to the user, with the reporting checkbox visible.

If the application needs to show its own custom interstitial UI, the callback can be invoked asynchronously with SafeBrowsingResponse#backToSafety or SafeBrowsingResponse#proceed, depending on user response.

Java documentation for android.webkit.WebViewClient.onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to