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

enableWebExtension

open fun enableWebExtension(extension: WebExtension, source: EnableSource = EnableSource.USER, onSuccess: (WebExtension) -> Unit = { }, onError: (Throwable) -> Unit = { }): Unit (source)

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.

Parameters

extension - the extension to enable.

source - EnableSource to indicate why the extension is enabled.

onSuccess - (optional) callback invoked with the enabled WebExtension

onError - (optional) callback invoked if there was an error enabling the extensions. This callback is invoked with an UnsupportedOperationException in case the engine doesn’t have web extension support.