android-components / mozilla.components.browser.engine.servo / ServoEngineSession

ServoEngineSession

class ServoEngineSession : EngineSession (source)

Servo-based EngineSession implementation.

Constructors

<init>

ServoEngineSession(defaultSettings: Settings? = null)

Servo-based EngineSession implementation.

Properties

settings

val settings: Settings

Provides access to the settings of this engine session.

Functions

captureThumbnail

fun captureThumbnail(): Bitmap?

Takes a screenshot of the actual tab

clearData

fun clearData(): Unit

Clears all user data sources available.

clearFindMatches

fun clearFindMatches(): Unit

Clears the highlighted results of previous calls to findAll / findNext.

disableTrackingProtection

fun disableTrackingProtection(): Unit

Disables tracking protection for this engine session.

enableTrackingProtection

fun enableTrackingProtection(policy: TrackingProtectionPolicy): Unit

Enables tracking protection for this engine session.

exitFullScreenMode

fun exitFullScreenMode(): Unit

Exits fullscreen mode if currently in it that state.

findAll

fun findAll(text: String): Unit

Finds and highlights all occurrences of the provided String and highlights them asynchronously.

findNext

fun findNext(forward: Boolean): Unit

Finds and highlights the next or previous match found by findAll.

goBack

fun goBack(): Unit

Navigates back in the history of this session.

goForward

fun goForward(): Unit

Navigates forward in the history of this session.

loadData

fun loadData(data: String, mimeType: String, encoding: String): Unit

Loads the data with the given mimeType. Example:

loadUrl

fun loadUrl(url: String): Unit

Loads the given URL.

reload

fun reload(): Unit

Reloads the current URL.

restoreState

fun restoreState(state: Map<String, Any>): Unit

Restores the engine state as provided by saveState.

saveState

fun saveState(): Map<String, Any>

Saves and returns the engine state. Engine implementations are not required to persist the state anywhere else than in the returned map. Engines that already provide a serialized state can use a single entry in this map to provide this state. The only requirement is that the same map can be used to restore the original state. See restoreState and the specific engine implementation for details.

stopLoading

fun stopLoading(): Unit

Stops loading the current session.

toggleDesktopMode

fun toggleDesktopMode(enable: Boolean, reload: Boolean): Unit

Enables/disables Desktop Mode with an optional ability to reload the session right after.

Inherited Functions

close

fun close(): Unit

Close the session. This may free underlying objects. Call this when you are finished using this session.