Webkit
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| January 25, 2023 | 1.6.0 | - | - | 1.7.0-alpha01 |
Declaring dependencies
To add a dependency on Webkit, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies {
implementation "androidx.webkit:webkit:1.6.0"
}
Kotlin
dependencies {
implementation("androidx.webkit:webkit:1.6.0")
}
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
Version 1.7
Version 1.7.0-alpha01
January 25, 2023
androidx.webkit:webkit:1.7.0-alpha01 is released. Version 1.7.0-alpha01 contains these commits.
New Features
- We are adding support for Image drag in
WebView. You can enable your users to drag images out of theWebViewby adding the newDropDataContentProviderto your app's manifest. (05a1a6)
Version 1.6
Version 1.6.0
January 25, 2023
androidx.webkit:webkit:1.6.0 is released. Version 1.6.0 contains these commits.
Important changes since 1.5.0
- A new ProcessGlobalConfig API has been added to allow apps to provide configuration settings that need to be set before loading WebView, such as the WebView data directory suffix. The configuration should be set up and applied as early as possible during application startup, to ensure that it happens before any other thread can call a method that loads
WebViewinto the process. - A new CookieManagerCompat API has been added to expand android.webkit.CookieManager with a new
getCookieInfomethod, which retrieves all attributes for all cookies set on a specific URL. This differs from the existing getCookie API inCookieManagerwhich returns only the name and value attributes of the cookies. WebSettingsCompathas new methods to enable/disable the effect ofEnterpriseAuthenticationAppLinkPolicyif set by admin inWebView, and to get the current setting. This feature lets WebView open an Authentication app instead of opening the authentication URL. This feature has no effect on devices that are not managed by an enterprise policy.- Adding a new API to
WebSettingsCompatto let applications explicitly send the app package name in theX-Requested-Withheader to allowlisted origins. The header has traditionally been sent on every request fromWebView.
Version 1.6.0-rc01
January 11, 2023
androidx.webkit:webkit:1.6.0-rc01 is released. Version 1.6.0-rc01 contains these commits.
Bug Fixes
- Fixed
NullPointerExceptioninWebViewFeature.isStartupFeatureSupported(Context, String)when running on SDK < L. (Ic7292)
Version 1.6.0-beta01
December 7, 2022
androidx.webkit:webkit:1.6.0-beta01 is released. Version 1.6.0-beta01 contains these commits.
API Changes
ProcessGlobalConfighas been changed to use a normal constructor and a static apply method. The apply method should only be called once per process, as early as possible, and will throwIllegalStateExceptionif called more than once.ProcessGlobalConfigobjects no longer have any restrictions on how many times setters can be called. (I456c3)
Version 1.6.0-alpha03
November 9, 2022
androidx.webkit:webkit:1.6.0-alpha03 is released. Version 1.6.0-alpha03 contains these commits.
New Features
- Add
ProcessGlobalConfigclass enabling users to set process global config before loadingWebView.WebViewhas some process-global configuration parameters that cannot be changed onceWebViewhas been loaded (e.g. theWebViewdata directory). This class allows apps to set these parameters. The configuration should be set up and applied as early as possible during application startup, to ensure that it happens before any other thread can call a method that loadsWebViewinto the process. (I7c0e0, b/250553687) - Adding new API to let applications explicitly send the app package name in the X-Requested-With header to allowlisted origins. The header has traditionally been sent on every request from
WebView. (I0adfe, b/226552535)
API Changes
- The
WebSettingsCompat#setAlgorithmicDarkeningAllowedAPI is supported on all Android versions inWebViewversion 105 and later. Previous versions ofWebViewonly supported the API on Android Q and later. As a result, this api is no longer marked@RequiresApi(Build.VERSION_CODES.Q). (I3ac1d)
Version 1.6.0-alpha02
October 24, 2022
androidx.webkit:webkit:1.6.0-alpha02 is released. Version 1.6.0-alpha02 contains these commits.
New Features
- Adds a new
CookieManagerCompatclass along with agetCookieInfoAPI which retrieves all attributes for all cookies set on a specific URL. This differs from the existinggetCookieAPI inCookieManagerwhich returns only the name and value attributes of the cookies. (I07365, b/242161756)
Version 1.6.0-alpha01
August 24, 2022
androidx.webkit:webkit:1.6.0-alpha01 is released. Version 1.6.0-alpha01 contains these commits.
New Features
- Added APIs in
WebSettingsCompatto enable/disable the effect ofEnterpriseAuthenticationAppLinkPolicyif set by admin inWebView. This feature letsWebViewopen an Authentication app instead of opening the authentication URL. This feature has no effect on devices that are not managed by an enterprise policy.
Version 1.5.0
Version 1.5.0
August 24, 2022
androidx.webkit:webkit:1.5.0 is released. Version 1.5.0 contains these commits.
Important changes since 1.4.0
- A new
setAlgorithmicDarkeningAllowedAPI onWebSettingsCompatreplaces the oldsetForceDarkandsetForceDarkStrategyAPIs. Apps targeting SDK 33 and higher (T) should use the new API, as the old API will no longer have any effect for those apps. - An allow-list of URLs to use the configured proxy can now be set through
ProxyCofig.Builderby settingsetReverseBypassEnabledtotrue. When this is in effect, all other URLs will bypass the configured proxy.
Version 1.5.0-rc01
August 10, 2022
androidx.webkit:webkit:1.5.0-rc01 is released with no changes since 1.5.0-beta01. Version 1.5.0-rc01 contains these commits.
Version 1.5.0-beta01
June 29, 2022
androidx.webkit:webkit:1.5.0-beta01 is released. Version 1.5.0-beta01 contains these commits.
API Changes
- Alogrithimic Darkening related APIs are now annotated to require API level Q. The API will not have any effect on API levels < Q, since dark theme is not an option on these devices. (I0905e)
Version 1.5.0-alpha01
May 18, 2022
androidx.webkit:webkit:1.5.0-alpha01 is released. Version 1.5.0-alpha01 contains these commits.
New Features
- Add a new
getVariationsHeader()method onWebViewCompatto get the X-Client-Data header value sent by theWebView. The returned value will be a base64 encoded ClientVariations protobuf. - Add APIs on
WebSettingsCompatto allow/disallow algorithmic darkening for app with targetSdk >= 33. (I29597)
API Changes
- Add a new method in
ProxyCofig.Builderto set reverse bypass. Setting reverse bypass to true means only URLs in the bypass list will use the proxy settings. (I9eaa2, b/168728599)
Bug Fixes
- Fixed a typo in dark theme documentation. (I36ebf, b/194343633)
- Fixed a bug where
WebViewAssetLoader.Buildermethods were unintentionally order-dependent. (If420d, b/182196765)
Version 1.4.0
Version 1.4.0
December 16, 2020
androidx.webkit:webkit:1.4.0 is released. Version 1.4.0 contains these commits.
Major changes since 1.3.0
- Added a new
setSafeBrowsingAllowlist()API to replacesetSafeBrowsingWhitelist(). This helps apps update their code to avoid non-inclusive terminology, while still supporting the same range of Android SDKs and WebView versions as the deprecated API. - Fixed a bug in setProxyOverride that caused fallback rules not being correctly applied.
Version 1.4.0-rc02
December 2, 2020
androidx.webkit:webkit:1.4.0-rc02 is released. Version 1.4.0-rc02 contains these commits.
Bug Fixes
- Fixes fallback rules not being correctly applied when using setProxyOverride.
Version 1.4.0-rc01
November 11, 2020
androidx.webkit:webkit:1.4.0-rc01 is released with no changes since 1.4.0-beta01. Version 1.4.0-rc01 contains these commits.
Version 1.4.0-beta01
October 14, 2020
androidx.webkit:webkit:1.4.0-beta01 is released with no changes since 1.4.0-alpha01. Version 1.4.0-beta01 contains these commits.
Version 1.4.0-alpha01
September 16, 2020
androidx.webkit:webkit:1.4.0-alpha01 is released. Version 1.4.0-alpha01 contains these commits.
API Changes
- Added a new
WebViewCompat#setSafeBrowsingAllowlist()API to replacesetSafeBrowsingWhitelist(). This helps apps update their code to avoid non-inclusive terminology, while still supporting the same range of Android SDKs and WebView versions as the deprecated API. (I8d65d)
Version 1.3.0
Version 1.3.0
August 19, 2020
androidx.webkit:webkit:1.3.0 is released. Version 1.3.0 contains these commits.
Major changes since 1.2.0
- ForceDarkStrategy API provides more control to WebView darkening (CSS/web content darkening versus auto darkening).
- WebMessageListener and its related APIs provide a simple and secure mechanism to establish communication between web contents and the WebView embedder app.
isMultiProcessEnabledAPI to check whether WebView is running in multi process. This is possible starting in Android O and it means web content is rendered in a sandboxed renderer process separate to the application process. This sandboxed renderer may be shared with other WebViews in the same application but it's not shared with other application processes.
Version 1.3.0-rc02
August 5, 2020
androidx.webkit:webkit:1.3.0-rc02 is released. Version 1.3.0-rc02 contains these commits.
Bug Fixes
- This fixes a compatibility issue where
WebMessageListenerwould sometimes crash during local development if your app was started with Android Studio instant run.
Version 1.3.0-rc01
June 24, 2020
androidx.webkit:webkit:1.3.0-rc01 is released with no changes since 1.3.0-beta01. Version 1.3.0-rc01 contains these commits.
Version 1.3.0-beta01
June 10, 2020
androidx.webkit:webkit:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.
New Features
ForceDarkStrategyAPI to control WebView darkening (CSS/web content darkening versus auto darkening).WebMessageListenerAPIs provide a simple and secure mechanism to establish communication between web contents and the WebView embedder app.MultiProcessEnabledAPI to check if WebView is running in multi process mode.
Version 1.3.0-alpha03
May 27, 2020
androidx.webkit:webkit:1.3.0-alpha03 is released. Version 1.3.0-alpha03 contains these commits.
API Changes
addWebMessageListenermethod now receives aSet<String>of allowed origin rules (previously aList<String>).
Version 1.3.0-alpha02
April 29, 2020
androidx.webkit:webkit:1.3.0-alpha02 is released. Version 1.3.0-alpha02 contains these commits.
New Features
- MultiProcessEnabled API to check if WebView is running in multi process mode.
API Changes
- All dark strategy constants are now prefixed with
DARK_STRATEGY.
Version 1.3.0-alpha01
April 15, 2020
androidx.webkit:webkit:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
New Features
ForceDarkStrategyAPI to controlWebViewdarkening (CSS/web content darkening versus auto darkening).WebMessageListenerAPIs provide a simple and secure mechanism to establish communication between web contents and the WebView embedder app.
Version 1.2.0
Version 1.2.0
March 4, 2020
androidx.webkit:webkit:1.2.0 is released. Version 1.2.0 contains these commits.
Major changes since 1.1.0
- Added the ForceDark API to control if WebViews should be rendered in dark mode.
Version 1.2.0-rc01
February 19, 2020
androidx.webkit:webkit:1.2.0-rc01 is released with no changes since 1.2.0-beta01. Version 1.2.0-rc01 contains these commits.
Version 1.2.0-beta01
February 5, 2020
androidx.webkit:webkit:1.2.0-beta01 is released with no changes since 1.2.0-alpha01. Version 1.2.0-beta01 contains these commits.
Version 1.2.0-alpha01
December 18, 2019
androidx.webkit:webkit:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
New features
- ForceDark API to control if WebViews should be rendered in dark mode.
Version 1.1.0
Version 1.1.0
November 7, 2019
androidx.webkit:webkit:1.1.0 is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
- Getter APIs to complement setWebViewClient() and setWebChromeClient().
- ProxyController API to set a network request proxy for an app's WebViews.
- WebViewAssetLoader API to simplify loading APK assets, resources, and files from the app data directory via request interception. This allows access to web and local resources without disabling CORS.
- TracingController API to collect WebView tracing information for debugging purposes.
- RenderProcess APIs to manage WebView renderer services, and to detect when poorly behaved content causes WebView renderers to become unresponsive.
- Updated existing APIs to include nullability (
@NonNull,@Nullable) and thread (@UiThread,@WorkerThread) annotations.
Version 1.1.0-rc01
October 9, 2019
androidx.webkit:webkit:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
Bug fixes
- Fixed an issue where
setWebViewRenderProcessClient()could crash if passed a null client.
Version 1.1.0-beta01
September 5, 2019
androidx.webkit:webkit:1.1.0-beta01 is released. The commits included in this version can be found here.
New features
- New
InternalStoragePathHandlerinWebViewAssetLoaderto load files from the app's data directory.
API changes
ProxyConfig#getProxyRules()now returns an unmodifiable list ofProxyRuleinstances, which is a new class to hold a scheme filter and its corresponding proxy URL.
Bug fixes
WebViewAssetLoaderdefaults to a "text/plain" MIME type (rather than null) when it can't guess the MIME type from the file path.WebViewAssetLoaderno longer throws aNullPointerExceptionwhen loading files with special characters in their path names.
Version 1.1.0-alpha02
August 7, 2019
androidx.webkit:webkit:1.1.0-alpha02 is released. The commits included in this version can be found here.
New features
WebViewAssetLoaderexposes thePathHandlerinterface to allow apps to create custom path-handling functionality.
API changes
WebViewAssetLoaderis now a final class, since it's not meant to be subclassed.WebViewAssetLoader#PathHandlerimplementations are now public and final.- Minor changes to ProxyConfig method names.
ProxyController: added new methodsaddDirect()andaddDirect(String)to connect directly to servers; removed DIRECT String.- Updated existing APIs to include nullability (
@NonNull,@Nullable) and thread (@UiThread,@WorkerThread) annotations.
Version 1.1.0-alpha01
May 7, 2019
androidx.webkit:webkit:1.1.0-alpha01 is released. The commits included in this version can be found here.
New features
- Getter APIs to complement
setWebViewClient()andsetWebChromeClient() - ProxyController API to set a network request proxy for an app's WebViews.
- AssetLoader API to simplify loading APK assets and resources via request interception, allowing access to web resources without disabling CORS.
- TracingController API to collect WebView tracing information for debugging purposes.
- RenderProcess APIs to manage WebView renderer services, and to detect when poorly behaved content causes WebView renderers to become unresponsive.
Bug fixes
- Minor fixes to documentation formatting for existing APIs.

