WebViewModeInitializer

Binds a WebView to the WebView profile associated with a BrowserMode, isolating cookies and origin-keyed storage (LocalStorage, IndexedDB) between modes.

Must be called once per WebView before any other WebView API call, including loadUrl. The binding is permanent for the lifetime of the WebView — it cannot be changed once the WebView has been used.

Fails on devices that do not support the MULTI_PROFILE WebView feature, regardless of the requested BrowserMode.

Functions

Link copied to clipboard
abstract fun bind(webView: WebView, mode: BrowserMode): Result<Unit>

Must be called on the main thread.