CefriumViewState

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

Hoisted state for CefriumView, created with rememberCefriumViewState.

The underlying CefriumBrowser is owned by this state, NOT by the CefriumView composable. That lets the browser survive the composable being detached — e.g. when switching browser tabs the inactive tab keeps its page alive instead of reloading. The browser is released by close:

  • automatically when a state created via rememberCefriumViewState leaves composition (via RememberObserver);

  • explicitly by the caller for states constructed directly (e.g. one per tab, closed when the tab closes).

Constructors

Link copied to clipboard
constructor(initialUrl: String, navigationState: ByteArray? = null, incognito: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A pending context-menu request from the page, or null. When non-null, show your menu UI, call CefriumNavigator.contextMenuCommand with the chosen command id, then set this back to null to dismiss.

Link copied to clipboard

Find-in-page: 1-based ordinal of the active match (0 = none).

Link copied to clipboard

Find-in-page: total matches for the current query (0 = none).

Link copied to clipboard
val incognito: Boolean = false
Link copied to clipboard
Link copied to clipboard

True while a page element is in HTML5 fullscreen.

Link copied to clipboard
Link copied to clipboard

The most recent download update (null until the first download).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set when a renderer process for this page dies (an OEM low-memory kill or a crash). When non-null the page is now blank/dead -- show a reload affordance and reload (e.g. via CefriumNavigator.reload). Cleared automatically when the next load starts, so the affordance dismisses itself on recovery.

Functions

Link copied to clipboard
fun close()

Releases the browser. Idempotent.

Link copied to clipboard
open override fun onAbandoned()
Link copied to clipboard
fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean

Forward the hosting Activity's onActivityResult to this browser so the file picker (<input type=file>, File System Access), camera capture and other intent-for-result flows can deliver their result. Call this from your Activity's onActivityResult for every visible state. Returns true if the result was consumed.

Link copied to clipboard
open override fun onForgotten()
Link copied to clipboard
open override fun onRemembered()