android-components / mozilla.components.concept.engine.webextension / Port

Port

abstract class Port (source)

Represents a port for exchanging messages: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port

Constructors

Name Summary
<init> Port(engineSession: EngineSession? = null)
Represents a port for exchanging messages: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port

Properties

Name Summary
engineSession val engineSession: EngineSession?

Functions

Name Summary
disconnect abstract fun disconnect(): Unit
Disconnects this port.
name abstract fun name(): String
Returns the name of this port.
postMessage abstract fun postMessage(message: <ERROR CLASS>): Unit
Sends a message to this port.
senderUrl abstract fun senderUrl(): String
Returns the URL of the port sender.

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.

Inheritors

Name Summary
GeckoPort class GeckoPort : Port
Gecko-based implementation of Port, wrapping the native port provided by GeckoView.