# Profile

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/Profile.java+class:androidx.webkit.Profile) Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

*** ** * ** ***


```
interface Profile
```

<br />

*** ** * ** ***

A Profile represents one browsing session for WebView.

You can have multiple profiles and each profile holds its own set of data. The creation and deletion of the Profile is being managed by `https://developer.android.com/reference/kotlin/androidx/webkit/ProfileStore`.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#CLASS) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = [https://developer.android.com/reference/java/lang/annotation/ElementType.html#METHOD, https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE, https://developer.android.com/reference/java/lang/annotation/ElementType.html#FIELD]) @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn(level = https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn.Level#ERROR) annotation https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalAddQuicHints` Denotes that the Profile#addQuicHints API surface is experimental. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#CLASS) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = [https://developer.android.com/reference/java/lang/annotation/ElementType.html#METHOD, https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE, https://developer.android.com/reference/java/lang/annotation/ElementType.html#FIELD]) @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn(level = https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn.Level#ERROR) annotation https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalPreconnect` Denotes that the Profile#preconnect API surface is experimental. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#CLASS) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = [https://developer.android.com/reference/java/lang/annotation/ElementType.html#METHOD, https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE, https://developer.android.com/reference/java/lang/annotation/ElementType.html#FIELD]) @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn(level = https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn.Level#ERROR) annotation https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch` Denotes that the UrlPrefetch API surface is experimental. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#CLASS) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = [https://developer.android.com/reference/java/lang/annotation/ElementType.html#METHOD, https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE, https://developer.android.com/reference/java/lang/annotation/ElementType.html#FIELD]) @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn(level = https://developer.android.com/reference/kotlin/androidx/annotation/RequiresOptIn.Level#ERROR) annotation https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalWarmUpRendererProcess` Denotes that the WarmUpRendererProcess API surface is experimental. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#DEFAULT_PROFILE_NAME() = "Default"` Represents the name of the default profile which can't be deleted. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)(header: https://developer.android.com/reference/kotlin/androidx/webkit/CustomHeader)` Add a header for outgoing requests that match the given origin rules. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.ADD_QUIC_HINTS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalAddQuicHints [addQuicHints](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addQuicHints(java.util.Set<java.lang.String>))(urls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>)` **This function is deprecated.** This method is being renamed to `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preferQuicFor(java.util.Set<java.lang.String>)`, use that instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#clearAllCustomHeaders()()` Remove any currently set headers from being applied to network requests. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#clearCustomHeader(java.lang.String)(headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Removes the specified headers from the set of headers attached to requests. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#clearCustomHeader(java.lang.String,java.lang.String)(headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, headerValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Removes the specified header from the set of headers attached to requests. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch https://developer.android.com/reference/kotlin/androidx/webkit/Profile#clearMaxPrerenders()()` Resets the max prerenders for the current profile session to system default. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.ENQUEUE_PRECONNECT, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalPreconnect https://developer.android.com/reference/kotlin/androidx/webkit/Profile#enqueuePreconnect(java.lang.String)(url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Enqueue a network preconnect to occur once WebView has started up. |
| `https://developer.android.com/reference/android/webkit/CookieManager.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getCookieManager()()` Returns the profile's cookie manager. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CROSS_ORIGIN_ISOLATED_ALLOWLIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getCrossOriginIsolatedAllowlist()()` Get the current allowlist of origins, with explicitly written ports, for cross-origin isolated APIs. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/webkit/CustomHeader!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getCustomHeaders()()` Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)`. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/webkit/CustomHeader!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getCustomHeaders(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` which have the specified `name`. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/webkit/CustomHeader!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getCustomHeaders(java.lang.String,java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` which have the specified `name` and `value`. |
| `https://developer.android.com/reference/android/webkit/GeolocationPermissions.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getGeolocationPermissions()()` Returns the geolocation permissions of the profile. |
| `https://developer.android.com/reference/kotlin/androidx/webkit/HttpCache` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.HTTP_CACHE_MANAGER, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getHttpCache()()` Returns the `https://developer.android.com/reference/kotlin/androidx/webkit/HttpCache` associated with this `https://developer.android.com/reference/kotlin/androidx/webkit/Profile`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getMaxPrerenders()()` Returns maximum prerenders for the current profile session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getName()()` Returns the name of this Profile. |
| `https://developer.android.com/reference/android/webkit/ServiceWorkerController.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getServiceWorkerController()()` Returns the service worker controller of the profile. |
| `https://developer.android.com/reference/android/webkit/WebStorage.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/Profile#getWebStorage()()` Returns the profile's web storage. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#hasCustomHeader(java.lang.String)(headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns true if the profile has a value set for the given header name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.PRECONNECT, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalPreconnect https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preconnect(java.lang.String)(url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Preconnect to the given origin to speed up future network requests. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.ADD_QUIC_HINTS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalAddQuicHints https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preferQuicFor(java.util.Set<java.lang.String>)(urls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>)` Advises that the given origins support the QUIC protocol and that WebView should use that to connect to them. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.PROFILE_URL_PREFETCH, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch [prefetchUrlAsync](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.WebViewOutcomeReceiver<java.lang.Void,androidx.webkit.PrefetchException>))( url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?, callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html?, outcomeReceiver: https://developer.android.com/reference/kotlin/androidx/webkit/WebViewOutcomeReceiver<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchException!> )` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.WebViewOutcomeReceiver<androidx.webkit.PrefetchResult,androidx.webkit.PrefetchException>)` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.PROFILE_URL_PREFETCH, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch [prefetchUrlAsync](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.SpeculativeLoadingParameters,androidx.webkit.WebViewOutcomeReceiver<java.lang.Void,androidx.webkit.PrefetchException>))( url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?, callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html?, speculativeLoadingParameters: https://developer.android.com/reference/kotlin/androidx/webkit/SpeculativeLoadingParameters, outcomeReceiver: https://developer.android.com/reference/kotlin/androidx/webkit/WebViewOutcomeReceiver<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchException!> )` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.PrefetchParameters,androidx.webkit.WebViewOutcomeReceiver<androidx.webkit.PrefetchResult,androidx.webkit.PrefetchException>)` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.CROSS_ORIGIN_ISOLATED_ALLOWLIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setCrossOriginIsolatedAllowlist(java.util.Set<java.lang.String>)( allowedOriginRules: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Set the list of origin patterns where [Cross Origin Isolated APIs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy/cross-origin-isolated) should be accessible. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setMaxPrerenders(int)(maxPrerenders: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the max prerenders for the current profile session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.SPECULATIVE_LOADING_CONFIG, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalUrlPrefetch [setSpeculativeLoadingConfig](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setSpeculativeLoadingConfig(androidx.webkit.SpeculativeLoadingConfig))( speculativeLoadingConfig: https://developer.android.com/reference/kotlin/androidx/webkit/SpeculativeLoadingConfig )` **This function is deprecated.** use `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setMaxPrerenders(int)`, `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#setMaxPrefetches(int)` and `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#setPrefetchTtlSeconds(int)` instead. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.WARM_UP_RENDERER_PROCESS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") @https://developer.android.com/reference/kotlin/androidx/annotation/UiThread @https://developer.android.com/reference/kotlin/androidx/webkit/Profile.ExperimentalWarmUpRendererProcess https://developer.android.com/reference/kotlin/androidx/webkit/Profile#warmUpRendererProcess()()` Initiates warm-up of the renderer process associated with this Profile. |

## Constants

### DEFAULT_PROFILE_NAME

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
const val DEFAULT_PROFILE_NAME = "Default": String!
```

Represents the name of the default profile which can't be deleted.

## Public functions

### addCustomHeader

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun addCustomHeader(header: CustomHeader): Unit
```

Add a header for outgoing requests that match the given origin rules.

Changes to custom headers take effect on document load. For document-initiated requests (such as subresources, `fetch()`, and `XMLHttpRequest`), the header will only apply to documents that begin loading after this method is called; it does not affect requests initiated by documents that are already loaded. Similarly, for requests sent from service workers, the header will only apply to service workers that are started after this method is called; it does not affect requests sent from service workers that are already running. The header also applies to navigation requests to load new documents and prefetch requests. It does not apply to WebSocket requests.

Headers added through this API will be present in the set returned by getRequestHeaders provided in shouldInterceptRequest.

If this method is called multiple times with headers that have the same name and value, then the sets of origin rules will be merged into a single set.

If multiple headers with the same name but different values match a request, then all the values will be sent in a comma-separated list of values following the guidance for [repeated header fields](https://www.rfc-editor.org/rfc/rfc7230#section-3.2.2). This does not take into account whether such merging is safe.

Headers are considered the same if their `name` matches case-insensitive and their `value` matches case-sensitive. This follows [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names), which states that "field names are case insensitive". This API will use the casing of the first custom header encountered.

| Parameters |
|---|---|
| `header: https://developer.android.com/reference/kotlin/androidx/webkit/CustomHeader` | The header to add. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### addQuicHints

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0) Deprecated in [1.18.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
@RequiresFeature(name = WebViewFeature.ADD_QUIC_HINTS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalAddQuicHints
fun [addQuicHints](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addQuicHints(java.util.Set<java.lang.String>))(urls: (Mutable)Set<String>): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> This method is being renamed to `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preferQuicFor(java.util.Set<java.lang.String>)`, use that instead. There is no difference in functionality.

Advises that the given origins support the QUIC protocol and that WebView should use that to connect to them.

By default, when connecting to a new server, WebView attempts both a HTTP3 (QUIC) and HTTP2 connection, choosing the one that responds faster. This can lead to cases where HTTP2 responds faster, even though HTTP3 is supported and would result in a faster overall load. Calling this API tells WebView to prefer HTTP3 connections for these origins.

Note: addQuicHints operates on origins, but for convenience full URLs can be provided. A full URL (such as `https://www.example.com/index.html`) will be treated as its origin (`https://www.example.com`).

This method can be called multiple times and the result is additive - QUIC hints are applied to all of the origins provided to all calls. Providing the same origin multiple times has no further effect.

URLs provided can be wildcards (such as `https://*.example.com` or `https://*`) when `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#ADD_QUIC_HINTS_WILDCARDS()` is supported, following the same rules as `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat#addWebMessageListener(android.webkit.WebView,java.lang.String,java.util.Set<java.lang.String>,androidx.webkit.WebViewCompat.WebMessageListener)`.

| Parameters |
|---|---|
| `urls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | A set of urls representing origins that support the QUIC protocol, url can be a wildcard when `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#ADD_QUIC_HINTS_WILDCARDS()` is supported. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#ADD_QUIC_HINTS_V1()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### clearAllCustomHeaders

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun clearAllCustomHeaders(): Unit
```

Remove any currently set headers from being applied to network requests.

Changes to custom headers take effect on document load. For document-initiated requests, headers will only be removed for documents that begin loading after this method is called; requests initiated by documents that are already loaded will continue to send previously configured headers.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` |   |

### clearCustomHeader

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun clearCustomHeader(headerName: String): Unit
```

Removes the specified headers from the set of headers attached to requests. This will remove all configured headers that match `headerName`.

Changes to custom headers take effect on document load. For document-initiated requests, the header will only be removed for documents that begin loading after this method is called; requests initiated by documents that are already loaded will continue to send previously configured headers.

It is safe to call this method even if `headerName` has not previously been set via `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)`.

This method is case insensitive.

| Parameters |
|---|---|
| `headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Header to remove. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` |   |

### clearCustomHeader

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun clearCustomHeader(headerName: String, headerValue: String): Unit
```

Removes the specified header from the set of headers attached to requests.

Changes to custom headers take effect on document load. For document-initiated requests, the header will only be removed for documents that begin loading after this method is called; requests initiated by documents that are already loaded will continue to send previously configured headers.

It is safe to call this method even if `(headerName, headerValue)` has not previously been set via `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)`.

This method is case insensitive for `name` but case-sensitive for `value`.

| Parameters |
|---|---|
| `headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Header name to remove. |
| `headerValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Header value to remove. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` |   |

### clearMaxPrerenders

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalUrlPrefetch
fun clearMaxPrerenders(): Unit
```

Resets the max prerenders for the current profile session to system default. This configuration will be applied to any prerender requests made after they are set; they will not be applied to in-flight requests.

This configuration will be applied to WebViews that are associated with this Profile.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#SET_MAX_PRERENDERS_V1()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### enqueuePreconnect

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.ENQUEUE_PRECONNECT, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalPreconnect
fun enqueuePreconnect(url: String): Unit
```

Enqueue a network preconnect to occur once WebView has started up.

This method acts like `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preconnect(java.lang.String)` but doesn't trigger WebView start up. Instead, it enqueues that action for when WebView start up occurs. If the WebView has already started, this method acts exactly like `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preconnect(java.lang.String)`

| Parameters |
|---|---|
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | A url containing the origin to open a connection to. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#ENQUEUE_PRECONNECT()` feature is not supported. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#preconnect(java.lang.String)` |   |

### getCookieManager

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getCookieManager(): CookieManager
```

Returns the profile's cookie manager.

Can be called from any thread.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the profile has been deleted by `https://developer.android.com/reference/kotlin/androidx/webkit/ProfileStore#deleteProfile(java.lang.String)`}. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#MULTI_PROFILE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getCrossOriginIsolatedAllowlist

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
@RequiresFeature(name = WebViewFeature.CROSS_ORIGIN_ISOLATED_ALLOWLIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun getCrossOriginIsolatedAllowlist(): (Mutable)Set<String!>
```

Get the current allowlist of origins, with explicitly written ports, for cross-origin isolated APIs.

If setting the origin rule `https://example.com`, this method will return the same origin rule as `https://example.com:443`).

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | An empty set if no allowlist has been set. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CROSS_ORIGIN_ISOLATED_ALLOWLIST()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getCustomHeaders

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun getCustomHeaders(): (Mutable)Set<CustomHeader!>
```

Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getCustomHeaders

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun getCustomHeaders(name: String): (Mutable)Set<CustomHeader!>
```

Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` which have the specified `name`.

This method is case insensitive.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of headers to get. Case sensitive. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getCustomHeaders

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun getCustomHeaders(name: String, value: String): (Mutable)Set<CustomHeader!>
```

Returns all custom headers set with `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` which have the specified `name` and `value`.

This method is case insensitive for `name` but case-sensitive for `value`.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Name of headers to get. Case sensitive. |
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Value of headers to get. Case sensitive. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getGeolocationPermissions

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getGeolocationPermissions(): GeolocationPermissions
```

Returns the geolocation permissions of the profile.

Can be called from any thread.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the profile has been deleted by `https://developer.android.com/reference/kotlin/androidx/webkit/ProfileStore#deleteProfile(java.lang.String)`}. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#MULTI_PROFILE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getHttpCache

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.HTTP_CACHE_MANAGER, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun getHttpCache(): HttpCache
```

Returns the `https://developer.android.com/reference/kotlin/androidx/webkit/HttpCache` associated with this `https://developer.android.com/reference/kotlin/androidx/webkit/Profile`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#HTTP_CACHE_MANAGER()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getMaxPrerenders

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalUrlPrefetch
fun getMaxPrerenders(): Int
```

Returns maximum prerenders for the current profile session.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#SET_MAX_PRERENDERS_V1()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getName

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getName(): String
```

Returns the name of this Profile.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the name of this Profile which was used to create the Profile from ProfileStore create methods. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#MULTI_PROFILE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getServiceWorkerController

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getServiceWorkerController(): ServiceWorkerController
```

Returns the service worker controller of the profile.

Can be called from any thread.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the profile has been deleted by `https://developer.android.com/reference/kotlin/androidx/webkit/ProfileStore#deleteProfile(java.lang.String)`}. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#MULTI_PROFILE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### getWebStorage

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.9.0)

```
@AnyThread
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getWebStorage(): WebStorage
```

Returns the profile's web storage.

Can be called from any thread.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if the profile has been deleted by `https://developer.android.com/reference/kotlin/androidx/webkit/ProfileStore#deleteProfile(java.lang.String)`}. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#MULTI_PROFILE()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### hasCustomHeader

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.CUSTOM_REQUEST_HEADERS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun hasCustomHeader(headerName: String): Boolean
```

Returns true if the profile has a value set for the given header name.

This method is case insensitive.

| Parameters |
|---|---|
| `headerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | A [valid HTTP header name string](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if there is a value mapped for the provided ` headerName`, {code false} otherwise. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CUSTOM_REQUEST_HEADERS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#addCustomHeader(androidx.webkit.CustomHeader)` |   |

### preconnect

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.PRECONNECT, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalPreconnect
fun preconnect(url: String): Unit
```

Preconnect to the given origin to speed up future network requests.

Opens a connection to the provided origin, performing DNS lookup and TCP/TLS handshakes. This can speed up future loads to the origin which could use the open connection. The connection will remain open (and can be reused by future loads) until it times out (roughly 30s).

The main benefit of this API is to preconnect to origins that haven't yet been visited by a WebView - it provides no further performance benefit to origins that have already been loaded.

Note: Preconnect operates on origins, but for convenience full URLs can be provided. A call with a full URL (such as `https://www.example.com/index.html`) will be treated as a call to the origin (`https://www.example.com`).

Multiple origins can be connected to by calling this API multiple times.

See: [HTML Preconnect Specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preconnect)

| Parameters |
|---|---|
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | A url containing the origin to open a connection to. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#PRECONNECT()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### preferQuicFor

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
@RequiresFeature(name = WebViewFeature.ADD_QUIC_HINTS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalAddQuicHints
fun preferQuicFor(urls: (Mutable)Set<String>): Unit
```

Advises that the given origins support the QUIC protocol and that WebView should use that to connect to them.

By default, when connecting to a new server, WebView attempts both a HTTP3 (QUIC) and HTTP2 connection, choosing the one that responds faster. This can lead to cases where HTTP2 responds faster, even though HTTP3 is supported and would result in a faster overall load. Calling this API tells WebView to prefer HTTP3 connections for these origins.

Note: preferQuicFor operates on origins, but for convenience full URLs can be provided. A full URL (such as `https://www.example.com/index.html`) will be treated as its origin (`https://www.example.com`).

This method can be called multiple times and the result is additive - QUIC hints are applied to all of the origins provided to all calls. Providing the same origin multiple times has no further effect.

| Parameters |
|---|---|
| `urls: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | A set of urls representing origins that support the QUIC protocol. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#ADD_QUIC_HINTS_V1()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### prefetchUrlAsync

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0) Deprecated in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.PROFILE_URL_PREFETCH, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@AnyThread
@Profile.ExperimentalUrlPrefetch
fun [prefetchUrlAsync](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.WebViewOutcomeReceiver<java.lang.Void,androidx.webkit.PrefetchException>))(
    url: String,
    cancellationSignal: CancellationSignal?,
    callbackExecutor: Executor?,
    outcomeReceiver: WebViewOutcomeReceiver<Void?, PrefetchException!>
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.WebViewOutcomeReceiver<androidx.webkit.PrefetchResult,androidx.webkit.PrefetchException>)` instead.

Starts a URL prefetch request.

All WebViews associated with this Profile will use a URL request matching algorithm during execution of all variants of `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String)` for determining if there was already a prefetch request executed for the provided URL. This includes prefetches that are "in progress". If a prefetch is matched, WebView will leverage that for handling the URL, otherwise the URL will be handled normally (i.e. through a network request).

Applications will still be responsible for calling `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String)` to display web contents in a WebView.

NOTE: Additional headers passed to `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String, java.util.Map&lt;java.lang.String,java.lang.String&gt;)` are not considered in the matching algorithm for determining whether or not to serve a prefetched response to a navigation.

For max latency saving benefits, it is recommended to call this method as early as possible (i.e. before any WebView associated with this profile is created).

Only supports HTTPS scheme.

| Parameters |
|---|---|
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the url associated with the prefetch request. |
| `cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?` | will make the best effort to cancel an in-flight prefetch request, However cancellation is not guaranteed. |
| `callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html?` | the executor to resolve the callback with. If `null`, the callback will be executed on the main thread. |
| `outcomeReceiver: https://developer.android.com/reference/kotlin/androidx/webkit/WebViewOutcomeReceiver<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchException!>` | callbacks for reporting result back to application. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the url or callback is null. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#PROFILE_URL_PREFETCH()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### prefetchUrlAsync

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0) Deprecated in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.PROFILE_URL_PREFETCH, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@AnyThread
@Profile.ExperimentalUrlPrefetch
fun [prefetchUrlAsync](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.SpeculativeLoadingParameters,androidx.webkit.WebViewOutcomeReceiver<java.lang.Void,androidx.webkit.PrefetchException>))(
    url: String,
    cancellationSignal: CancellationSignal?,
    callbackExecutor: Executor?,
    speculativeLoadingParameters: SpeculativeLoadingParameters,
    outcomeReceiver: WebViewOutcomeReceiver<Void?, PrefetchException!>
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#prefetchUrlAsync(java.lang.String,android.os.CancellationSignal,java.util.concurrent.Executor,androidx.webkit.PrefetchParameters,androidx.webkit.WebViewOutcomeReceiver<androidx.webkit.PrefetchResult,androidx.webkit.PrefetchException>)` instead.

Starts a URL prefetch request.

All WebViews associated with this Profile will use a URL request matching algorithm during execution of all variants of `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String)` for determining if there was already a prefetch request executed for the provided URL. This includes prefetches that are "in progress". If a prefetch is matched, WebView will leverage that for handling the URL, otherwise the URL will be handled normally (i.e. through a network request).

Applications will still be responsible for calling `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String)` to display web contents in a WebView.

NOTE: Additional headers passed to `https://developer.android.com/reference/android/webkit/WebView.html#loadUrl(java.lang.String, java.util.Map&lt;java.lang.String,java.lang.String&gt;)` are not considered in the matching algorithm for determining whether or not to serve a prefetched response to a navigation.

For max latency saving benefits, it is recommended to call this method as early as possible (i.e. before any WebView associated with this profile is created).

Only supports HTTPS scheme.

| Parameters |
|---|---|
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the url associated with the prefetch request. |
| `cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html?` | will make the best effort to cancel an in-flight prefetch request, However cancellation is not guaranteed. |
| `callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html?` | the executor to resolve the callback with. If `null`, the callback will be executed on the main thread. |
| `speculativeLoadingParameters: https://developer.android.com/reference/kotlin/androidx/webkit/SpeculativeLoadingParameters` | parameters to customize the prefetch request. |
| `outcomeReceiver: https://developer.android.com/reference/kotlin/androidx/webkit/WebViewOutcomeReceiver<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchException!>` | callbacks for reporting result back to application. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the url or callback is null. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#PROFILE_URL_PREFETCH()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### setCrossOriginIsolatedAllowlist

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
@RequiresFeature(name = WebViewFeature.CROSS_ORIGIN_ISOLATED_ALLOWLIST, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
fun setCrossOriginIsolatedAllowlist(
    allowedOriginRules: (Mutable)Set<String!>
): Unit
```

Set the list of origin patterns where [Cross Origin Isolated APIs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy/cross-origin-isolated) should be accessible.

This API allows you to set an allowlist of origins where potentially risky APIs will be enabled, provided the loaded page has the correct [`Document-Isolation-Policy`](https://developer.chrome.com/blog/document-isolation-policy) response header.

WebView does not enable this feature by default because WebView does not support renderer process isolation. By calling this API, you acknowledge that it is OK to relax this security guarantee and allow pages to use cross-origin-isolated APIs, for example [SharedArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) even if they are running in a shared renderer process. For this reason, you should only use this API with origins you trust.

You should also avoid using the wildcard matcher (`"*"`) in the `originPatterns` for the same reason.

This method will affect pages that are already loaded.

| Parameters |
|---|---|
| `allowedOriginRules: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | A set of origin patterns where cross-origin-isolated APIs should be available. Avoid using the wildcard matcher. See the documentation for `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewCompat#addWebMessageListener(android.webkit.WebView,java.lang.String,java.util.Set<java.lang.String>,androidx.webkit.WebViewCompat.WebMessageListener)` for syntax. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if one or more of the patterns cannot be parsed. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#CROSS_ORIGIN_ISOLATED_ALLOWLIST()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### setMaxPrerenders

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
@RequiresFeature(name = WebViewFeature.SET_MAX_PRERENDERS_V1, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalUrlPrefetch
fun setMaxPrerenders(maxPrerenders: @IntRange(from = 1) Int): Unit
```

Sets the max prerenders for the current profile session. These configurations will be applied to any prerender requests made after they are set; they will not be applied to in-flight requests.

These configurations will be applied to WebViews that are associated with this Profile.

| Parameters |
|---|---|
| `maxPrerenders: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the prerender value to update. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#SET_MAX_PRERENDERS_V1()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### setSpeculativeLoadingConfig

Added in [1.13.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.13.0) Deprecated in [1.16.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.16.0)

```
@RequiresFeature(name = WebViewFeature.SPECULATIVE_LOADING_CONFIG, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalUrlPrefetch
fun [setSpeculativeLoadingConfig](https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setSpeculativeLoadingConfig(androidx.webkit.SpeculativeLoadingConfig))(
    speculativeLoadingConfig: SpeculativeLoadingConfig
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> use `https://developer.android.com/reference/kotlin/androidx/webkit/Profile#setMaxPrerenders(int)`, `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#setMaxPrefetches(int)` and `https://developer.android.com/reference/kotlin/androidx/webkit/PrefetchCache#setPrefetchTtlSeconds(int)` instead.

Sets the `https://developer.android.com/reference/kotlin/androidx/webkit/SpeculativeLoadingConfig` for the current profile session. These configurations will be applied to any Prefetch requests made after they are set; they will not be applied to in-flight requests.

These configurations will be applied to any prefetch requests initiated by a prerender request. This applies specifically to WebViews that are associated with this Profile.

| Parameters |
|---|---|
| `speculativeLoadingConfig: https://developer.android.com/reference/kotlin/androidx/webkit/SpeculativeLoadingConfig` | the config to set for this profile session. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#SPECULATIVE_LOADING_CONFIG()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |

### warmUpRendererProcess

Added in [1.15.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.15.0)

```
@RequiresFeature(name = WebViewFeature.WARM_UP_RENDERER_PROCESS, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
@UiThread
@Profile.ExperimentalWarmUpRendererProcess
fun warmUpRendererProcess(): Unit
```

Initiates warm-up of the renderer process associated with this Profile.

If no renderer currently exists for the profile, this will kick off the process of starting one in the background. This call does not block or guarantee that the renderer will be fully started by the time it returns.

This can be used to reduce perceived latency when a renderer is needed shortly after.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#WARM_UP_RENDERER_PROCESS()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |