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

updateWebExtension

open fun updateWebExtension(extension: WebExtension, onSuccess: (WebExtension?) -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit (source)

Updates the provided extension if a new version is available.

Parameters

extension - the extension to be updated.

onSuccess - (optional) callback invoked if the extension was updated successfully, providing access to the WebExtension object for bi-directional messaging, if null is provided that means that the WebExtension hasn’t been change since the last update.

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