Current implementation:
The WebInstallServiceResult is provided from WebInstallServiceImpl to HTMLInstallElement::OnInstallResult(). WebInstallServiceResult has 3 possible results: kSuccess, kAbortError, and kDataError.
Proposal: Good to keep as is
The question is how do we want to handle kDataError. Options to consider (but open to more ideas):
- Fire
promptdismiss (same as kAbortError)
- Probably difficult for developers to differentiate from kAbortErrors and kDataErrors and take appropriate actions.
- Update and add new
invalidReason (existing read-only InPagePermissionMixinBlockerReason that will block the element from being activated. Potential name: install_data_invalid (Naming not finalized).
- Do both A and B.
- Create a new read-only
InPagePermissionMixinBlockerReason similar to invalidReason, such as installDataInvalid. (Naming not finalized).
- Create a new Event and event handler similar to promptdismiss and onpromptdismiss, such as
promptinvalid since data errors are typically also a result of a user interaction. (Naming not finalized).
NOTE: WebInstallServiceResults are mapped to install_result_code.h - Chromium Code Search
- kSuccess
- InstallResultcode::kSuccess
- InstallResultcode:: kSuccessAlreadyInstalled
- kAbortError
- InstallResultCode::kUserInstallDeclined - User declines install or launch dialog
- Render frame host is null
- file:// or chrome:// urls used
- Permission denied by user (in content settings or page info)
- Unsupported profiles (Incognito or guest mode)
- Current web contents is being installed via another method
- Default for all other unexpected failures such as the browser crashing, network issues, etc.
- kDataError
- InstallResultCode::kNoCustomManifestId - For . No custom manifest id found in the manifest loaded from the provided install_url.
- InstallResultCode::kManifestIdMismatch - For
- InstallResultCode::kInstallURLLoadFailed - WebAppUrlLoader failed to load installurl
- InstallResultCode::kInstallURLRedirected - A redirecting installurl was used which currently isn’t supported. See crbug.com/471021583
- InstallResultCode::kNotValidManifestForWebApp - No valid manifest found
- InstallResultCode::kNotInstallable - Web App is not considered installable, i.e. missing manifest fields, no service worker, etc.
Current implementation:
The
WebInstallServiceResultis provided fromWebInstallServiceImpltoHTMLInstallElement::OnInstallResult().WebInstallServiceResulthas 3 possible results: kSuccess, kAbortError, and kDataError.Proposal: Good to keep as is
The question is how do we want to handle kDataError. Options to consider (but open to more ideas):
promptdismiss(same as kAbortError)invalidReason(existing read-only InPagePermissionMixinBlockerReason that will block the element from being activated. Potential name:install_data_invalid(Naming not finalized).InPagePermissionMixinBlockerReasonsimilar toinvalidReason, such asinstallDataInvalid. (Naming not finalized).promptinvalidsince data errors are typically also a result of a user interaction. (Naming not finalized).NOTE:
WebInstallServiceResultsare mapped to install_result_code.h - Chromium Code Search