android-components / mozilla.components.concept.engine / Engine

Engine

interface Engine (source)

Entry point for interacting with the engine implementation.

Types

Name Summary
BrowsingData class BrowsingData
Describes a combination of browsing data types stored by the engine.

Properties

Name Summary
settings abstract val settings: Settings
Provides access to the settings of this engine.
trackingProtectionExceptionStore open val trackingProtectionExceptionStore: TrackingProtectionExceptionStorage
Provides access to the tracking protection exception list for this engine.
version abstract val version: EngineVersion
Returns the version of the engine as EngineVersion object.

Functions

Name Summary
clearData open fun clearData(data: BrowsingData = BrowsingData.all(), host: String? = null, onSuccess: () -> Unit = { }, onError: (Throwable) -> Unit = { }): Unit
Clears browsing data stored by the engine.
createSession abstract fun createSession(private: Boolean = false): EngineSession
Creates a new engine session.
createSessionState abstract fun createSessionState(json: <ERROR CLASS>): EngineSessionState
Create a new EngineSessionState instance from the serialized JSON representation.
createView abstract fun createView(context: <ERROR CLASS>, attrs: <ERROR CLASS>? = null): EngineView
Creates a new view for rendering web content.
getTrackersLog open fun getTrackersLog(session: EngineSession, onSuccess: (List<TrackerLog>) -> Unit, onError: (Throwable) -> Unit = { }): Unit
Fetch a list of trackers logged for a given session .
installWebExtension open fun installWebExtension(id: String, url: String, allowContentMessaging: Boolean = true, onSuccess: (WebExtension) -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Installs the provided extension in this engine.
name abstract fun name(): String
Returns the name of this engine. The returned string might be used in filenames and must therefore only contain valid filename characters.
registerWebExtensionDelegate open fun registerWebExtensionDelegate(webExtensionDelegate: WebExtensionDelegate): Unit
Registers a WebExtensionDelegate to be notified of engine events related to web extensions
registerWebNotificationDelegate open fun registerWebNotificationDelegate(webNotificationDelegate: WebNotificationDelegate): Unit
Registers a WebNotificationDelegate to be notified of engine events related to web notifications
registerWebPushDelegate open fun registerWebPushDelegate(webPushDelegate: WebPushDelegate): WebPushHandler
Registers a WebPushDelegate to be notified of engine events related to web extensions.
speculativeConnect abstract fun speculativeConnect(url: String): Unit
Opens a speculative connection to the host of url.
warmUp open fun warmUp(): Unit
Makes sure all required engine initialization logic is executed. The details are specific to individual implementations, but the following must be true:

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.

Inheritors

Name Summary
GeckoEngine class GeckoEngine : Engine
Gecko-based implementation of Engine interface.
SystemEngine class SystemEngine : Engine
WebView-based implementation of the Engine interface.