android-components / / WebExtensionSupport


object WebExtensionSupport (source)

Provides functionality to make sure web extension related events in the WebExtensionRuntime are reflected in the browser state by dispatching the corresponding actions to the BrowserStore.

Note that this class can be removed once the browser-state migration is completed and the WebExtensionRuntime (engine) has direct access to the BrowserStore:


Name Summary
installedExtensions val installedExtensions: ConcurrentHashMap<String, WebExtension>


Name Summary
awaitInitialization suspend fun awaitInitialization(): Unit
Awaits for completion of the initialization process (completes when the state of all installed extensions is known).
initialize fun initialize(runtime: WebExtensionRuntime, store: BrowserStore, openPopupInTab: Boolean = false, onNewTabOverride: (WebExtension?, EngineSession, String) -> String = null, onCloseTabOverride: (WebExtension?, String) -> Unit = null, onSelectTabOverride: (WebExtension?, String) -> Unit = null, onUpdatePermissionRequest: onUpdatePermissionRequest? = { _, _, _, _ -> }, onExtensionsLoaded: (List<WebExtension>) -> Unit = null): Unit
Registers a listener for web extension related events on the provided WebExtensionRuntime and reacts by dispatching the corresponding actions to the provided BrowserStore.
markExtensionAsUpdated fun markExtensionAsUpdated(store: BrowserStore, updatedExtension: WebExtension): Unit
Marks the provided updatedExtension as updated in the store.

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.