You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### **Signatures of the `install` method (cross-origin)**
81
81
The cross-origin part of the Web Install API consists of the extension to the navigator interface with an `install` method. This method receives:
82
-
*`manifest_id`: declares the specific application to be installed. This is the unique id of the application that will be installed. This value must match the id specified in the manifest file.
83
-
*`install_url`: a url meant for installing an app. This url can be any url in scope of the manifest file that links to it. An `install_url` must not redirect nor contain extra content that is not relevant for installation purposes. In the absence of an `install_url`, the value defaults to that of the manifest's `start_url`.
82
+
*`manifest_id`: declares the specific application to be installed. This is the unique id of the application that will be installed. This value must match the id specified in the manifest file.
83
+
*`install_url`: a url meant for installing an app. This url can be any url in scope of the manifest file that links to it. An `install_url` must not redirect nor contain extra content that is not relevant for installation purposes.
84
84
* optional [parameters](#parameters).
85
85
86
86
If the `manifest_id` is the *what* to install, the `install_url` is the *where* to find it.
@@ -94,7 +94,7 @@ This will prompt for installation of the app if the requesting origin has instal
94
94
#### **Parameters**
95
95
96
96
The `navigator.install` call can receive an object with a set of parameters that specify different installation behaviours for the app. It is also a way to future-proof the API if additional data were required with the call.
97
-
***referral-info**: this parameter takes the form of an object that can have arbitrary information required by the calling installation domain. This information can later be retrieved inside the installed application via the [Acquisition Info API](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/AcquisitionInfo/explainer.md).
97
+
***referral-info**: this parameter takes the form of an object that can have arbitrary information required by the calling installation domain. This information can later be retrieved inside the installed application via the [Acquisition Info API](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/AcquisitionInfo/explainer.md).
98
98
99
99
#### **Installing the web app**
100
100
@@ -104,8 +104,8 @@ To install a same domain web site/app, the process is as follows:
104
104
3. If the target content is a web app with a manifest, check if the domain is in the list of [allowed origins](#install-sources-manifest-field) to install said content. If the target content is not a web app, it can't be installed.
105
105
3. Prompt the user for install confirmation. User is given a choice about whether to install the target content or not.
106
106
4. If the users accepts, the content is installed.
107
-
5. UA default action post-install (generally the app will open/be added to homescreen/start menu/dock).
108
-
107
+
5. UA default action post-install (generally the app will open/be added to homescreen/start menu/dock).
108
+
109
109
### The `navigator.getInstalledApps` method
110
110
111
111
If supported by the UA, the `getInstalledApps` method returns a list of the content that has been installed from *that* installation origin which is still installed on the device at the time of execution. This is an **async** method of the `navigator` interface that allows the installation origin to know which applications it has installed.
@@ -116,13 +116,13 @@ Additionally, if the browser has an active 'Do Not Track (DNT)', equivalent 'Glo
116
116
117
117
* The approach for showing which apps have been installed from this origin follows the same API approach where the information is accessible if it matches a [partition key](https://github.com/kyraseevers/Partitioning-visited-links-history#general-api-approach), instead of just the link URL. This ensures installed apps can be seen only from the origin matching all parts of the key.
118
118
119
-
## Relation with other web APIs/features
119
+
## Relation with other web APIs/features
120
120
121
121
***`navigator.install` and Permissions API:** see [integrations with the Permissions API](#integration-with-the-permissions-api).
122
122
123
123
***`navigator.install` and manifest file's `prefer_related_applications`:** When the `related_applications` and `prefer_related_applications` key/values are present in the manifest, the UA should try to handoff the install to the prefered catalog. If this is not possible then it fallback to a default UA install.
124
124
125
-
***`navigator.getInstalledApps` and `getInstalledRelatedApps`:**`getInstalledApps` is called from an origin and can list applications that are installed on the device originating from the current site. `getInstalledRelatedApps` on the other hand is called from a web app and returns which alternate versions of an app (platform specific versions for example) are already installed on the device.
125
+
***`navigator.getInstalledApps` and `getInstalledRelatedApps`:**`getInstalledApps` is called from an origin and can list applications that are installed on the device originating from the current site. `getInstalledRelatedApps` on the other hand is called from a web app and returns which alternate versions of an app (platform specific versions for example) are already installed on the device.
126
126
*`getInstalledApps` can be used to change install UX in online stores if an app is already installed (changing the text on a button from "Install" to "Open" for example).
127
127
*`getInstalledRelatedApps` can be used to "mute" notifications or hide install UI for a web application if an alternate version of the app is already installed (avoid duplicate notifications if a user has a web version and a platform-specific version of the same app for exmaple).
128
128
@@ -146,7 +146,7 @@ For cross-origin content, the target content must have an [`install_sources`](#i
146
146
147
147
* This API can only be invoked in a top-level navigable and be invoked from a [secure context](https://w3c.github.io/webappsec-secure-contexts/).
148
148
149
-
* The biggest risk for the API is installation spamming. To minimize this behaviour, installing a PWA using the Web Install API requires a [user activation](https://html.spec.whatwg.org/multipage/interaction.html#activation-triggering-input-event).
149
+
* The biggest risk for the API is installation spamming. To minimize this behaviour, installing a PWA using the Web Install API requires a [user activation](https://html.spec.whatwg.org/multipage/interaction.html#activation-triggering-input-event).
150
150
151
151
* A new permission type will be introduced for an origin, that would allow it to install web apps. The first time a website requests to install an app (use the API) the UA will prompt the user to confirm that the website can install other apps into the device. This prompt is similar to that of other permissions like geolocation or camera/microphone. The UA can decide how to implement this prompt.
152
152
@@ -211,7 +211,7 @@ In both cases of the default UA behaviour, developers can use the `install_sourc
0 commit comments