Package org.mozilla.geckoview
Interface WebExtension.PortDelegate
- Enclosing class:
- WebExtension
@UiThread
public static interface WebExtension.PortDelegate
Delegate that handles communication from a WebExtension on a specific
WebExtension.Port
instance.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Called whenever the correspondingWebExtension.Port
instance is disconnected or the correspondingGeckoSession
is destroyed.default void
onPortMessage
(Object message, WebExtension.Port port) Called whenever a message is sent through the correspondingWebExtension.Port
instance.
-
Method Details
-
onPortMessage
Called whenever a message is sent through the correspondingWebExtension.Port
instance.- Parameters:
message
- The message that was sent, either a primitive type or aJSONObject
.port
- TheWebExtension.Port
instance that received this message.
-
onDisconnect
Called whenever the correspondingWebExtension.Port
instance is disconnected or the correspondingGeckoSession
is destroyed. Any message sent from the port after this call will be ignored.- Parameters:
port
- TheWebExtension.Port
instance that was disconnected.
-