public class WebViewCompat
extends Object

   ↳ androidx.webkit.WebViewCompat

Compatibility version of WebView


Nested classes

interface WebViewCompat.VisualStateCallback

Callback interface supplied to WebViewCompat.postVisualStateCallback(WebView, long, WebViewCompat.VisualStateCallback) for receiving notifications about the visual state. 

interface WebViewCompat.WebMessageListener

This listener receives messages sent on the JavaScript object which was injected by WebViewCompat.addWebMessageListener(WebView, String, Set, WebViewCompat.WebMessageListener)

Public methods

static void addWebMessageListener(WebView webView, String jsObjectName, Set<String> allowedOriginRules, WebViewCompat.WebMessageListener listener)

Adds a WebViewCompat.WebMessageListener to the WebView and injects a JavaScript object into each frame that the WebViewCompat.WebMessageListener will listen on.

static WebMessagePortCompat[] createWebMessageChannel(WebView webview)

Creates a message channel to communicate with JS and returns the message ports that represent the endpoints of this message channel.

static PackageInfo getCurrentWebViewPackage(Context context)

If WebView has already been loaded into the current process this method will return the package that was used to load it.

static Uri getSafeBrowsingPrivacyPolicyUrl()

Returns a URL pointing to the privacy policy for Safe Browsing reporting.

static WebChromeClient getWebChromeClient(WebView webview)

Gets the WebChromeClient.

static WebViewClient getWebViewClient(WebView webview)

Gets the WebViewClient for the WebView argument.

static WebViewRenderProcess getWebViewRenderProcess(WebView webview)

Gets the WebView renderer associated with this WebView.

static WebViewRenderProcessClient getWebViewRenderProcessClient(WebView webview)

Gets the renderer client object associated with this WebView.

static boolean isMultiProcessEnabled()

Returns true if We