Cefrium Web View
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 -> }
)Content copied to clipboard
Parameters
url
The URL to load. Changes to this value trigger navigation.
modifier
Modifier for the browser view.
on Url Changed
Called when the browser navigates to a new URL.
on Title Changed
Called when the page title changes.
on Loading State Changed
Called when loading state changes.
on Fullscreen Changed
Called when fullscreen mode changes.
on Request Intercepted
Called for every network request (for inspection).
on Render Process Terminated
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.
on Browser Ready
Called with the CefriumBrowser instance for direct control.