Package org.mozilla.geckoview
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 Summary
Modifier and TypeMethodDescriptiononInstallPromptRequest(WebExtension extension, String[] permissions, String[] origins, String[] dataCollectionPermissions) Called whenever a new extension is being installed.default GeckoResult<AllowOrDeny>onOptionalPrompt(WebExtension extension, String[] permissions, String[] origins, String[] dataCollectionPermissions) Called whenever permissions are requested.default GeckoResult<AllowOrDeny>onUpdatePrompt(WebExtension extension, String[] newPermissions, String[] newOrigins, String[] newDataCollectionPermissions) Called whenever an updated extension has new permissions.
-
Method Details
-
onInstallPromptRequest
@Nullable default GeckoResult<WebExtension.PermissionPromptResponse> onInstallPromptRequest(@NonNull WebExtension extension, @NonNull String[] permissions, @NonNull String[] origins, @NonNull String[] dataCollectionPermissions) 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- TheWebExtensionthat is about to be installed. You can useWebExtension.metaDatato 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.dataCollectionPermissions- The list of data collection permissions that are requested during installation.- Returns:
- A
GeckoResultthat completes with aWebExtension.PermissionPromptResponsecontaining all the details from the user response.
-
onUpdatePrompt
@Nullable default GeckoResult<AllowOrDeny> onUpdatePrompt(@NonNull WebExtension extension, @NonNull String[] newPermissions, @NonNull String[] newOrigins, @NonNull String[] newDataCollectionPermissions) 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:
extension- TheWebExtensionbeing updated.newPermissions- The new permissions that are needed.newOrigins- The new origins that are needed.newDataCollectionPermissions- The new data collection permissions that are needed.- Returns:
- A
GeckoResultthat completes to eitherALLOWif this extension should be update orDENYif this extension should not be update. A null value will be interpreted asDENY.
-
onOptionalPrompt
@Nullable default GeckoResult<AllowOrDeny> onOptionalPrompt(@NonNull WebExtension extension, @NonNull String[] permissions, @NonNull String[] origins, @NonNull String[] dataCollectionPermissions) 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- TheWebExtensionthat is about to be installed. You can useWebExtension.metaDatato gather information about this extension when building the user prompt dialog.permissions- The permissions that are requested.origins- The requested host permissions.dataCollectionPermissions- The requested data collection permissions.- Returns:
- A
GeckoResultthat completes to eitherALLOWif the request should be approved orDENYif the request should be denied. A null value will be interpreted asDENY.
-