Interface WebExtension.ActionDelegate

Enclosing class:
WebExtension

public static interface WebExtension.ActionDelegate
Receives updates whenever a Browser action or a Page action has been defined by an extension.

This delegate will receive the default action when registered with WebExtension.setActionDelegate(org.mozilla.geckoview.WebExtension.ActionDelegate). To receive GeckoSession-specific overrides you can use WebExtension.SessionController.setActionDelegate(org.mozilla.geckoview.WebExtension, org.mozilla.geckoview.WebExtension.ActionDelegate).

  • Method Details

    • onBrowserAction

      @UiThread default void onBrowserAction(@NonNull WebExtension extension, @Nullable GeckoSession session, @NonNull WebExtension.Action action)
      Called whenever a browser action is defined or updated.

      This method will be called whenever an extension that defines a browser action is registered or the properties of the Action are updated.

      See also WebExtensions/API/browserAction , WebExtensions/manifest.json/browser_action .

      Parameters:
      extension - The extension that defined this browser action.
      session - Either the GeckoSession corresponding to the tab to which this Action override applies. null if action is the new default value.
      action - WebExtension.Action containing the override values for this GeckoSession or the default value if session is null.
    • onPageAction

      @UiThread default void onPageAction(@NonNull WebExtension extension, @Nullable GeckoSession session, @NonNull WebExtension.Action action)
      Called whenever a page action is defined or updated.

      This method will be called whenever an extension that defines a page action is registered or the properties of the Action are updated.

      See also WebExtensions/API/pageAction , WebExtensions/manifest.json/page_action .

      Parameters:
      extension - The extension that defined this page action.
      session - Either the GeckoSession corresponding to the tab to which this Action override applies. null if action is the new default value.
      action - WebExtension.Action containing the override values for this GeckoSession or the default value if session is null.
    • onTogglePopup

      @UiThread @Nullable default GeckoResult<GeckoSession> onTogglePopup(@NonNull WebExtension extension, @NonNull WebExtension.Action action)
      Called whenever the action wants to toggle a popup view.
      Parameters:
      extension - The extension that wants to display a popup
      action - The action where the popup is defined
      Returns:
      A GeckoSession that will be used to display the pop-up, null if no popup will be displayed.
    • onOpenPopup

      @UiThread @Nullable default GeckoResult<GeckoSession> onOpenPopup(@NonNull WebExtension extension, @NonNull WebExtension.Action action)
      Called whenever the action wants to open a popup view.
      Parameters:
      extension - The extension that wants to display a popup
      action - The action where the popup is defined
      Returns:
      A GeckoSession that will be used to display the pop-up, null if no popup will be displayed.