Webkit
Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
---|---|---|---|---|
May 18, 2022 | 1.4.0 | - | - | 1.5.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.4.0" }
Kotlin
dependencies { implementation("androidx.webkit:webkit:1.4.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.5.0
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 onWebViewCompat
to get the X-Client-Data header value sent by theWebView
. The returned value will be a base64 encoded ClientVariations protobuf. - Add APIs on
WebSettingsCompat
to allow/disallow algorithmic darkening for app with targetSdk >= 33. (I29597)
API Changes
- Add a new method in
ProxyCofig.Builder
to 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.Builder
methods 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.
isMultiProcessEnabled
API 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
WebMessageListener
would 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
ForceDarkStrategy
API to control WebView darkening (CSS/web content darkening versus auto darkening).WebMessageListener
APIs provide a simple and secure mechanism to establish communication between web contents and the WebView embedder app.MultiProcessEnabled
API 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
addWebMessageListener
method 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
ForceDarkStrategy
API to controlWebView
darkening (CSS/web content darkening versus auto darkening).WebMessageListener
APIs 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
InternalStoragePathHandler
inWebViewAssetLoader
to load files from the app's data directory.
API changes
ProxyConfig#getProxyRules()
now returns an unmodifiable list ofProxyRule
instances, which is a new class to hold a scheme filter and its corresponding proxy URL.
Bug fixes
WebViewAssetLoader
defaults to a "text/plain" MIME type (rather than null) when it can't guess the MIME type from the file path.WebViewAssetLoader
no longer throws aNullPointerException
when 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
WebViewAssetLoader
exposes thePathHandler
interface to allow apps to create custom path-handling functionality.
API changes
WebViewAssetLoader
is now a final class, since it's not meant to be subclassed.WebViewAssetLoader#PathHandler
implementations 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.