android-components / mozilla.components.browser.engine.gecko.webextension / GeckoWebExtension

GeckoWebExtension

class GeckoWebExtension : WebExtension (source)

Gecko-based implementation of WebExtension, wrapping the native web extension object provided by GeckoView.

Types

Name Summary
PortId data class PortId
Uniquely identifies a port using its name and the session it was opened for. Ports connected from background scripts will have a null session.

Constructors

Name Summary
<init> GeckoWebExtension(nativeExtension: WebExtension, runtime: GeckoRuntime)
Gecko-based implementation of WebExtension, wrapping the native web extension object provided by GeckoView.

Properties

Name Summary
nativeExtension val nativeExtension: WebExtension
runtime val runtime: GeckoRuntime

Inherited Properties

Name Summary
id val id: String
the unique ID of this extension.
supportActions val supportActions: Boolean
whether or not browser and page actions are handled when received from the web extension
url val url: String
the url pointing to a resources path for locating the extension within the APK file e.g. resource://android/assets/extensions/my_web_ext.

Functions

Name Summary
disconnectPort fun disconnectPort(name: String, session: EngineSession?): Unit
See WebExtension.disconnectPort.
getConnectedPort fun getConnectedPort(name: String, session: EngineSession?): Port?
See WebExtension.getConnectedPort.
getMetadata fun getMetadata(): Metadata?
See WebExtension.getMetadata.
hasActionHandler fun hasActionHandler(session: EngineSession): Boolean
See WebExtension.hasActionHandler.
hasContentMessageHandler fun hasContentMessageHandler(session: EngineSession, name: String): Boolean
See WebExtension.hasContentMessageHandler.
hasTabHandler fun hasTabHandler(session: EngineSession): Boolean
See WebExtension.hasTabHandler.
isAllowedInPrivateBrowsing fun isAllowedInPrivateBrowsing(): Boolean
Checks whether or not this extension is allowed in private browsing.
isBuiltIn fun isBuiltIn(): Boolean
Checks whether or not this extension is built-in (packaged with the APK file) or coming from an external source.
isEnabled fun isEnabled(): Boolean
Checks whether or not this extension is enabled.
registerActionHandler fun registerActionHandler(actionHandler: ActionHandler): Unit
fun registerActionHandler(session: EngineSession, actionHandler: ActionHandler): Unit
See WebExtension.registerActionHandler.
registerBackgroundMessageHandler fun registerBackgroundMessageHandler(name: String, messageHandler: MessageHandler): Unit
See WebExtension.registerBackgroundMessageHandler.
registerContentMessageHandler fun registerContentMessageHandler(session: EngineSession, name: String, messageHandler: MessageHandler): Unit
See WebExtension.registerContentMessageHandler.
registerTabHandler fun registerTabHandler(tabHandler: TabHandler): Unit
fun registerTabHandler(session: EngineSession, tabHandler: TabHandler): Unit
See WebExtension.registerTabHandler.

Extension Functions

Name Summary
isUnsupported fun WebExtension.isUnsupported(): Boolean
Returns whether or not the extension is disabled because it is unsupported.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.