CefriumWebView

fun CefriumWebView(url: String, modifier: Modifier = Modifier, onUrlChanged: (String) -> Unit? = null, onTitleChanged: (String) -> Unit? = null, onLoadingStateChanged: (Boolean, Boolean, Boolean) -> Unit? = null, onFullscreenChanged: (Boolean) -> Unit? = null, onRequestIntercepted: (String, String, Boolean) -> Unit? = null, onRenderProcessTerminated: (status: Int, errorCode: Int) -> Unit? = null, onBrowserReady: (CefriumBrowser) -> Unit? = null)

Composable that embeds a Cefrium browser with Surface rendering.

Handles browser lifecycle, URL/title callbacks, and cleanup. Video playback, audio, and ad blocking all work.

CefriumWebView(
url = "https://example.com",
modifier = Modifier.fillMaxSize(),
onUrlChanged = { url -> /* update state */},
onTitleChanged = { title -> /* update title */},
onLoadingStateChanged = { loading, canGoBack, canGoForward -> },
onFullscreenChanged = { fullscreen -> }
)

Parameters

url

The URL to load. Changes to this value trigger navigation.

modifier

Modifier for the browser view.

onUrlChanged

Called when the browser navigates to a new URL.

onTitleChanged

Called when the page title changes.

onLoadingStateChanged

Called when loading state changes.

onFullscreenChanged

Called when fullscreen mode changes.

onRequestIntercepted

Called for every network request (for inspection).

onRenderProcessTerminated

Called when a renderer process for this page dies (status, errorCode). The page is now blank -- show a reload affordance. Status values are the CefriumBrowser.TERMINATION_* constants.

onBrowserReady

Called with the CefriumBrowser instance for direct control.