Interface WebExtensionController.PromptDelegate

Enclosing class:
WebExtensionController

@UiThread public static interface WebExtensionController.PromptDelegate
This delegate will be called whenever an extension is about to be installed or it needs new permissions, e.g during an update or because it called permissions.request
  • Method Details

    • onInstallPromptRequest

      @Nullable default GeckoResult<WebExtension.PermissionPromptResponse> onInstallPromptRequest(@NonNull WebExtension extension, @NonNull String[] permissions, @NonNull String[] origins)
      Called whenever a new extension is being installed. This is intended as an opportunity for the app to prompt the user for the permissions required by this extension.
      Parameters:
      extension - The WebExtension that is about to be installed. You can use WebExtension.metaData to gather information about this extension when building the user prompt dialog.
      permissions - The list of permissions that are granted during installation.
      origins - The list of origins that are granted during installation.
      Returns:
      A GeckoResult that completes with a WebExtension.PermissionPromptResponse containing all the details from the user response.
    • onUpdatePrompt

      @Nullable default GeckoResult<AllowOrDeny> onUpdatePrompt(@NonNull WebExtension currentlyInstalled, @NonNull WebExtension updatedExtension, @NonNull String[] newPermissions, @NonNull String[] newOrigins)
      Called whenever an updated extension has new permissions. This is intended as an opportunity for the app to prompt the user for the new permissions required by this extension.
      Parameters:
      currentlyInstalled - The WebExtension that is currently installed.
      updatedExtension - The WebExtension that will replace the previous extension.
      newPermissions - The new permissions that are needed.
      newOrigins - The new origins that are needed.
      Returns:
      A GeckoResult that completes to either ALLOW if this extension should be update or DENY if this extension should not be update. A null value will be interpreted as DENY.
    • onOptionalPrompt

      @Nullable default GeckoResult<AllowOrDeny> onOptionalPrompt(@NonNull WebExtension extension, @NonNull String[] permissions, @NonNull String[] origins)
      Called whenever permissions are requested. This is intended as an opportunity for the app to prompt the user for the permissions required by this extension at runtime.
      Parameters:
      extension - The WebExtension that is about to be installed. You can use WebExtension.metaData to gather information about this extension when building the user prompt dialog.
      permissions - The permissions that are requested.
      origins - The requested host permissions.
      Returns:
      A GeckoResult that completes to either ALLOW if the request should be approved or DENY if the request should be denied. A null value will be interpreted as DENY.