belongs to Maven artifact androidx.webkit:webkit:1.0.0-alpha1

WebViewFeature

public class WebViewFeature
extends Object

java.lang.Object
   ↳ androidx.webkit.WebViewFeature


Utility class for checking which WebView Support Library features are supported on the device.

Summary

Constants

String DISABLED_ACTION_MODE_MENU_ITEMS

Feature for isFeatureSupported(String).

String OFF_SCREEN_PRERASTER

Feature for isFeatureSupported(String).

String RECEIVE_HTTP_ERROR

Feature for isFeatureSupported(String).

String RECEIVE_WEB_RESOURCE_ERROR

Feature for isFeatureSupported(String).

String SAFE_BROWSING_ENABLE

Feature for isFeatureSupported(String).

String SAFE_BROWSING_HIT

Feature for isFeatureSupported(String).

String SAFE_BROWSING_PRIVACY_POLICY_URL

Feature for isFeatureSupported(String).

String SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY

Feature for isFeatureSupported(String).

String SAFE_BROWSING_RESPONSE_PROCEED

Feature for isFeatureSupported(String).

String SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL

Feature for isFeatureSupported(String).

String SAFE_BROWSING_WHITELIST

Feature for isFeatureSupported(String).

String SERVICE_WORKER_BASIC_USAGE

Feature for isFeatureSupported(String).

String SERVICE_WORKER_BLOCK_NETWORK_LOADS

Feature for isFeatureSupported(String).

String SERVICE_WORKER_CACHE_MODE

Feature for isFeatureSupported(String).

String SERVICE_WORKER_CONTENT_ACCESS

Feature for isFeatureSupported(String).

String SERVICE_WORKER_FILE_ACCESS

Feature for isFeatureSupported(String).

String SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST

Feature for isFeatureSupported(String).

String SHOULD_OVERRIDE_WITH_REDIRECTS

Feature for isFeatureSupported(String).

String START_SAFE_BROWSING

Feature for isFeatureSupported(String).

String VISUAL_STATE_CALLBACK

Feature for isFeatureSupported(String).

String WEB_RESOURCE_ERROR_GET_CODE

Feature for isFeatureSupported(String).

String WEB_RESOURCE_ERROR_GET_DESCRIPTION

Feature for isFeatureSupported(String).

String WEB_RESOURCE_REQUEST_IS_REDIRECT

Feature for isFeatureSupported(String).

Public methods

static boolean isFeatureSupported(String feature)

Return whether a feature is supported at run-time.

Inherited methods

Constants

DISABLED_ACTION_MODE_MENU_ITEMS

String DISABLED_ACTION_MODE_MENU_ITEMS

Feature for isFeatureSupported(String). This feature covers WebSettingsCompat.getDisabledActionModeMenuItems(WebSettings), and WebSettingsCompat.setDisabledActionModeMenuItems(WebSettings, int).

Constant Value: "DISABLED_ACTION_MODE_MENU_ITEMS"

OFF_SCREEN_PRERASTER

String OFF_SCREEN_PRERASTER

Feature for isFeatureSupported(String). This feature covers WebSettingsCompat.getOffscreenPreRaster(WebSettings), and WebSettingsCompat.setOffscreenPreRaster(WebSettings, boolean).

Constant Value: "OFF_SCREEN_PRERASTER"

RECEIVE_HTTP_ERROR

String RECEIVE_HTTP_ERROR

Feature for isFeatureSupported(String). This feature covers WebViewClientCompat.onReceivedHttpError(android.webkit.WebView, WebResourceRequest, WebResourceResponse).

Constant Value: "RECEIVE_HTTP_ERROR"

RECEIVE_WEB_RESOURCE_ERROR

String RECEIVE_WEB_RESOURCE_ERROR

Feature for isFeatureSupported(String). This feature covers WebViewClientCompat.onReceivedError(android.webkit.WebView, WebResourceRequest, WebResourceErrorCompat).

Constant Value: "RECEIVE_WEB_RESOURCE_ERROR"

SAFE_BROWSING_ENABLE

String SAFE_BROWSING_ENABLE

Feature for isFeatureSupported(String). This feature covers WebSettingsCompat.getSafeBrowsingEnabled(WebSettings), and WebSettingsCompat.setSafeBrowsingEnabled(WebSettings, boolean).

Constant Value: "SAFE_BROWSING_ENABLE"

SAFE_BROWSING_HIT

String SAFE_BROWSING_HIT

Feature for isFeatureSupported(String). This feature covers WebViewClientCompat.onSafeBrowsingHit(android.webkit.WebView, WebResourceRequest, int, SafeBrowsingResponseCompat).

Constant Value: "SAFE_BROWSING_HIT"

SAFE_BROWSING_PRIVACY_POLICY_URL

String SAFE_BROWSING_PRIVACY_POLICY_URL

Feature for isFeatureSupported(String). This feature covers WebViewCompat.getSafeBrowsingPrivacyPolicyUrl().

Constant Value: "SAFE_BROWSING_PRIVACY_POLICY_URL"

SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY

String SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY

Feature for isFeatureSupported(String). This feature covers SafeBrowsingResponseCompat.backToSafety(boolean).

Constant Value: "SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY"

SAFE_BROWSING_RESPONSE_PROCEED

String SAFE_BROWSING_RESPONSE_PROCEED

Feature for isFeatureSupported(String). This feature covers SafeBrowsingResponseCompat.proceed(boolean).

Constant Value: "SAFE_BROWSING_RESPONSE_PROCEED"

SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL

String SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL

Feature for isFeatureSupported(String). This feature covers SafeBrowsingResponseCompat.showInterstitial(boolean).

Constant Value: "SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL"

SAFE_BROWSING_WHITELIST

String SAFE_BROWSING_WHITELIST

Feature for isFeatureSupported(String). This feature covers WebViewCompat.setSafeBrowsingWhitelist(List, ValueCallback).

Constant Value: "SAFE_BROWSING_WHITELIST"

SERVICE_WORKER_BASIC_USAGE

String SERVICE_WORKER_BASIC_USAGE

Feature for isFeatureSupported(String). This feature covers ServiceWorkerControllerCompat.getInstance().

Constant Value: "SERVICE_WORKER_BASIC_USAGE"

SERVICE_WORKER_BLOCK_NETWORK_LOADS

String SERVICE_WORKER_BLOCK_NETWORK_LOADS

Feature for isFeatureSupported(String). This feature covers ServiceWorkerWebSettingsCompat.getBlockNetworkLoads(), and ServiceWorkerWebSettingsCompat.setBlockNetworkLoads(boolean).

Constant Value: "SERVICE_WORKER_BLOCK_NETWORK_LOADS"

SERVICE_WORKER_CACHE_MODE

String SERVICE_WORKER_CACHE_MODE

Feature for isFeatureSupported(String). This feature covers ServiceWorkerWebSettingsCompat.getCacheMode(), and ServiceWorkerWebSettingsCompat.setCacheMode(int).

Constant Value: "SERVICE_WORKER_CACHE_MODE"

SERVICE_WORKER_CONTENT_ACCESS

String SERVICE_WORKER_CONTENT_ACCESS

Feature for isFeatureSupported(String). This feature covers ServiceWorkerWebSettingsCompat.getAllowContentAccess(), and ServiceWorkerWebSettingsCompat.setAllowContentAccess(boolean).

Constant Value: "SERVICE_WORKER_CONTENT_ACCESS"

SERVICE_WORKER_FILE_ACCESS

String SERVICE_WORKER_FILE_ACCESS

Feature for isFeatureSupported(String). This feature covers ServiceWorkerWebSettingsCompat.getAllowFileAccess(), and ServiceWorkerWebSettingsCompat.setAllowFileAccess(boolean).

Constant Value: "SERVICE_WORKER_FILE_ACCESS"

SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST

String SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST

Feature for isFeatureSupported(String). This feature covers ServiceWorkerClientCompat.shouldInterceptRequest(WebResourceRequest).

Constant Value: "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST"

SHOULD_OVERRIDE_WITH_REDIRECTS

String SHOULD_OVERRIDE_WITH_REDIRECTS

Feature for isFeatureSupported(String). This feature covers WebViewClientCompat.shouldOverrideUrlLoading(android.webkit.WebView, WebResourceRequest).

Constant Value: "SHOULD_OVERRIDE_WITH_REDIRECTS"

START_SAFE_BROWSING

String START_SAFE_BROWSING

Feature for isFeatureSupported(String). This feature covers WebViewCompat.startSafeBrowsing(Context, ValueCallback).

Constant Value: "START_SAFE_BROWSING"

VISUAL_STATE_CALLBACK

String VISUAL_STATE_CALLBACK

Feature for isFeatureSupported(String). This feature covers WebViewCompat.postVisualStateCallback(android.webkit.WebView, long, WebViewCompat.VisualStateCallback), and WebViewClientCompat.onPageCommitVisible(android.webkit.WebView, String).

Constant Value: "VISUAL_STATE_CALLBACK"

WEB_RESOURCE_ERROR_GET_CODE

String WEB_RESOURCE_ERROR_GET_CODE

Feature for isFeatureSupported(String). This feature covers WebResourceErrorCompat.getErrorCode().

Constant Value: "WEB_RESOURCE_ERROR_GET_CODE"

WEB_RESOURCE_ERROR_GET_DESCRIPTION

String WEB_RESOURCE_ERROR_GET_DESCRIPTION

Feature for isFeatureSupported(String). This feature covers WebResourceErrorCompat.getDescription().

Constant Value: "WEB_RESOURCE_ERROR_GET_DESCRIPTION"

WEB_RESOURCE_REQUEST_IS_REDIRECT

String WEB_RESOURCE_REQUEST_IS_REDIRECT

Feature for isFeatureSupported(String). This feature covers WebResourceRequestCompat.isRedirect(WebResourceRequest).

Constant Value: "WEB_RESOURCE_REQUEST_IS_REDIRECT"

Public methods

isFeatureSupported

boolean isFeatureSupported (String feature)

Return whether a feature is supported at run-time. This depends on the Android version of the device and the WebView APK on the device.

Parameters
feature String

Returns
boolean