@UiThread
public static interface WebExtension.PortDelegate
WebExtension.Port
instance.Modifier and Type | Method and Description |
---|---|
default void |
onDisconnect(WebExtension.Port port)
Called whenever the corresponding
WebExtension.Port instance is
disconnected or the corresponding GeckoSession is destroyed. |
default void |
onPortMessage(Object message,
WebExtension.Port port)
Called whenever a message is sent through the corresponding
WebExtension.Port instance. |
default void onPortMessage(@NonNull Object message, @NonNull WebExtension.Port port)
WebExtension.Port
instance.message
- The message that was sent, either a primitive type or
a JSONObject
.port
- The WebExtension.Port
instance that received this message.@NonNull default void onDisconnect(@NonNull WebExtension.Port port)
WebExtension.Port
instance is
disconnected or the corresponding GeckoSession
is destroyed.
Any message sent from the port after this call will be ignored.port
- The WebExtension.Port
instance that was disconnected.