Package-level declarations

Types

Link copied to clipboard

How a CefriumView reacts to the host lifecycle for INLINE MEDIA. The default (PAUSE_ON_STOP) is what most apps want: a video/audio inside the page stops when the host is backgrounded (HOME / recents) and resumes on return. Pick another policy -- or pass onHostLifecycle to CefriumView for full control -- if you need different behavior (e.g. a music player that keeps playing).

Link copied to clipboard

A bounded LRU pool of CefriumViewState for screens that show many different pages over time -- e.g. a list of lessons/articles, each rendered in a CefriumView.

Link copied to clipboard

External navigation control for a CefriumView, created with rememberCefriumNavigator and passed to the composable. It operates on the CefriumBrowser owned by the bound CefriumViewState.

Link copied to clipboard
class CefriumViewState(val initialUrl: String, val navigationState: ByteArray? = null, val incognito: Boolean = false) : RememberObserver

Hoisted state for CefriumView, created with rememberCefriumViewState.

Link copied to clipboard
data class ContextMenuInfo(val menuItems: String, val url: String)

A pending context-menu request, delivered via CefriumViewState.contextMenu. menuItems is the engine's serialized menu (the same payload the View API's context-menu listener receives); url is the link/page URL under the cursor.

Link copied to clipboard
data class DownloadInfo(val name: String, val path: String, val percent: Int, val complete: Boolean, val canceled: Boolean)

A download progress update, delivered via CefriumViewState.lastDownload.

Link copied to clipboard

Why a renderer process terminated. See RendererTermination.

Link copied to clipboard
data class RendererTermination(val status: RendererStatus, val errorCode: Int)

A renderer-process termination for the page, delivered via CefriumViewState.rendererTermination. errorCode is the platform error code (0 if none).

Functions

Link copied to clipboard
fun CefriumView(state: CefriumViewState, modifier: Modifier = Modifier, navigator: CefriumNavigator = rememberCefriumNavigator(), onQuery: (request: String, origin: String, callback: CefriumBrowser.QueryCallback) -> Boolean? = null, onBrowserReady: (CefriumBrowser) -> Unit? = null, backgroundMediaPolicy: BackgroundMediaPolicy = BackgroundMediaPolicy.PAUSE_ON_STOP, onHostLifecycle: (Lifecycle.Event, CefriumBrowser) -> Unit? = null)

Idiomatic Compose view backed by a full Chromium engine (Cefrium).

Link copied to clipboard
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.

Link copied to clipboard

Remembers a CefriumBrowserPool that keeps at most maxAlive browsers alive, closing the least-recently-used when you open another. Every pooled browser is released when this leaves composition. See CefriumBrowserPool for the pattern.

Link copied to clipboard

Remembers a CefriumNavigator across recompositions.

Link copied to clipboard

Remembers a CefriumViewState for url. The browser is released automatically when this leaves composition. For caller-managed lifecycles (e.g. a browser with tabs), construct CefriumViewState directly and call CefriumViewState.close.