+ This API adds the following internal slot to the {{Navigator}}
+ interface.
+
+
+
+ {{Promise}}? [[\installPromise]]
+
+
+ The [=this=].{{Navigator/[[installPromise]]}} is a promise that
+ represents a user's current intent to install an application. It is
+ initialized to `null`.
+
+
+
+ install() method
+
+
+ When the {{Navigator/install()}} method is called, run the following
+ steps to [=install=] the website.
+
+
+
Let |global:Window| be [=this=]'s [=relevant global object=].
+
+
Let |document:Document| be |global|'s [=associated Document=].
+
+
If |document| is not [=Document/fully active=], return [=a
+ promise rejected with=] an {{"InvalidStateError"}} {{DOMException}}.
+
+
If [=this=].{{Navigator/[[installPromise]]}} is not `null`,
+ return [=a promise rejected with=] an {{"InvalidStateError"}}
+ {{DOMException}}.
+
+
If |global| does not have [=transient activation=], return [=a
+ promise rejected with=] a {{"NotAllowedError"}} {{DOMException}}.
+
+
[=Consume user activation=] of |global|.
+
+
Set [=this=].{{Navigator/[[installPromise]]}} to be a new
+ promise.
+
+
Return [=this=].{{Navigator/[[installPromise]]}} and in
+ parallel:
+
+
[=Processing|Process=] the |document|'s [=manifest=].
+
+
If the |document|'s [=Document/processed manifest=] is null,
+ [=queue a global task=] on the [=user interaction task source=]
+ using |global| to:
+
+
[=Reject=] [=this=].{{Navigator/[[installPromise]]}} with
+ an {{"DataError"}} {{DOMException}}.
+
+
Set [=this=].{{Navigator/[[installPromise]]}} to `null`.
+
+
Terminate this algorithm.
+
+
+
+
Present an installation UI for the |document|'s
+ [=Document/processed manifest=].
+
+
+
Wait for the user's choice.
+
+
If the user chose to abort the install operation, or if
+ installing the application has failed, [=queue a global task=] on
+ the [=user interaction task source=] using |global| to:
+
+
[=Reject=] [=this=].{{Navigator/[[installPromise]]}} with
+ an {{"AbortError"}} {{DOMException}}.
+
+
Set [=this=].{{Navigator/[[installPromise]]}} to `null`.
+
+
Terminate this algorithm.
+
+
+
+
Otherwise, [=queue a global task=] on the [=user interaction
+ task source=] using |global| to:
+
+
[=Resolve=] [=this=].{{Navigator/[[installPromise]]}}
+ with `undefined`.
+
+
Set [=this=].{{Navigator/[[installPromise]]}} to `null`.
+