Interface WebExtension.PortDelegate

Enclosing class:

@UiThread public static interface WebExtension.PortDelegate
Delegate that handles communication from a WebExtension on a specific WebExtension.Port instance.
  • Method Details

    • onPortMessage

      default void onPortMessage(@NonNull Object message, @NonNull WebExtension.Port port)
      Called whenever a message is sent through the corresponding 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.
    • onDisconnect

      @NonNull default void onDisconnect(@NonNull WebExtension.Port port)
      Called whenever the corresponding 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.