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 voidCalled whenever the correspondingWebExtension.Portinstance is disconnected or the correspondingGeckoSessionis destroyed.default voidonPortMessage(Object message, WebExtension.Port port) Called whenever a message is sent through the correspondingWebExtension.Portinstance.
-
Method Details
-
onPortMessage
Called whenever a message is sent through the correspondingWebExtension.Portinstance.- Parameters:
message- The message that was sent, either a primitive type or aJSONObject.port- TheWebExtension.Portinstance that received this message.
-
onDisconnect
Called whenever the correspondingWebExtension.Portinstance is disconnected or the correspondingGeckoSessionis destroyed. Any message sent from the port after this call will be ignored.- Parameters:
port- TheWebExtension.Portinstance that was disconnected.
-