android-components / mozilla.components.concept.engine.webextension / WebExtensionRuntime

WebExtensionRuntime

interface WebExtensionRuntime (source)

Entry point for interacting with the web extensions.

Functions

Name Summary
disableWebExtension open fun disableWebExtension(extension: WebExtension, source: EnableSource = EnableSource.USER, onSuccess: (WebExtension) -> Unit, onError: (Throwable) -> Unit = { }): Unit
Disables the provided WebExtension. If the extension is already disabled the onSuccess callback will be invoked, but this method has no effect on the extension.
enableWebExtension open fun enableWebExtension(extension: WebExtension, source: EnableSource = EnableSource.USER, onSuccess: (WebExtension) -> Unit = { }, onError: (Throwable) -> Unit = { }): Unit
Enables the provided WebExtension. If the extension is already enabled the onSuccess callback will be invoked, but this method has no effect on the extension.
installWebExtension open fun installWebExtension(id: String, url: String, allowContentMessaging: Boolean = true, supportActions: Boolean = false, onSuccess: (WebExtension) -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Installs the provided extension in this engine.
listInstalledWebExtensions open fun listInstalledWebExtensions(onSuccess: (List<WebExtension>) -> Unit, onError: (Throwable) -> Unit = { }): Unit
Lists the currently installed web extensions in this engine.
registerWebExtensionDelegate open fun registerWebExtensionDelegate(webExtensionDelegate: WebExtensionDelegate): Unit
Registers a WebExtensionDelegate to be notified of engine events related to web extensions
uninstallWebExtension open fun uninstallWebExtension(ext: WebExtension, onSuccess: () -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Uninstalls the provided extension from this engine.
updateWebExtension open fun updateWebExtension(extension: WebExtension, onSuccess: (WebExtension?) -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Updates the provided extension if a new version is available.

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
Engine interface Engine : WebExtensionRuntime, DataCleanable
Entry point for interacting with the engine implementation.
GeckoEngine class GeckoEngine : Engine, WebExtensionRuntime
Gecko-based implementation of Engine interface.