android-components / mozilla.components.feature.addons / AddonManager

AddonManager

class AddonManager (source)

Provides access to installed and recommended Addons and manages their states.

Constructors

Name Summary
<init> AddonManager(store: BrowserStore, engine: Engine, addonsProvider: AddonsProvider, addonUpdater: AddonUpdater)
Provides access to installed and recommended Addons and manages their states.

Functions

Name Summary
disableAddon fun disableAddon(addon: Addon, onSuccess: (Addon) -> Unit = { }, onError: (Throwable) -> Unit = { }): Unit
Disables the provided Addon.
enableAddon fun enableAddon(addon: Addon, onSuccess: (Addon) -> Unit = { }, onError: (Throwable) -> Unit = { }): Unit
Enables the provided Addon.
getAddons suspend fun getAddons(waitForPendingActions: Boolean = true): List<Addon>
Returns the list of all installed and recommended add-ons.
installAddon fun installAddon(addon: Addon, onSuccess: (Addon) -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Installs the provided Addon.
uninstallAddon fun uninstallAddon(addon: Addon, onSuccess: () -> Unit = { }, onError: (String, Throwable) -> Unit = { _, _ -> }): Unit
Uninstalls the provided Addon.
updateAddon fun updateAddon(id: String, onFinish: (Status) -> Unit): Unit
Updates the addon with the provided id if an update 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.