#946: Web Install API - Cross-Origin
Discussions
Log in to see TAG-private discussions.
Comment by @LeaVerou Apr 15, 2024 (See Github)
@plinss, @hober and I looked at this today during a breakout. We didn't quite understand how the flow is supposed to work for the app store use case. How would the app store get manifest ids, given that it seems the only way to procure a manifest id is after installation? Why not simply provide URLs to manifest files? What does the additional complexity of a manifest id get us?
Also, the install_sources
field seems to largely be replicating CORS functionality. Obviously, installing is a markedly different use case than reading, so there needs to be some way to declare the author intent that not every website that can read the manifest should be able to install the app, but an Access-Control-Allow-*
header seems like a more natural fit for this.
Comment by @hober Jun 18, 2024 (See Github)
@diekus, did you see @LeaVerou's questions above?
Comment by @diekus Jun 27, 2024 (See Github)
Hola @hober @plinss and @LeaVerou,
Thanks for your patience! In the app store use case, the developer must already have this information. Could be asked when an app is being submitted or previous information that someone wanting to link and install 3P apps can easily find out. For cross-origin installs, the installing origin needs to have the to-be-installed origin's manifest id beforehand. Part of the reason we prefer to have an id for the app instead of pointing to the manifest's URL is because this URL can change. The id
does not point to a resource that can be navigated to. It is just a unique way to identify the application.
About CORS I think this is good feedback! I'd like to keep CORS functionality implementation open to a future/parallel expansion of Web Install for sure. To start though, CORS is a bit less developer friendly, and thinking about developer ergonomics I'd like to have the install origins definition not rely (only) on headers.
If both CORS and manifest install_sources
were to be supported in the future, do you see this as an acceptable solution?
cc @amandabaker @dmurph
Comment by @hober Jun 28, 2024 (See Github)
@diekus wrote:
For cross-origin installs, the installing origin needs to have the to-be-installed origin's manifest id beforehand.
Why? Having a manifest at all isn't required for the same-origin installation case, so why require it in the cross-origin one?
Comment by @hober Jun 28, 2024 (See Github)
@diekus wrote:
For cross-origin installs, the installing origin needs to have the to-be-installed origin's manifest id beforehand.
Why? Having a manifest at all isn't required for the same-origin installation case, so why require it in the cross-origin one?
Put another way: if any website can provide a button for the user to add it to the Home Screen or Dock, and if it's reasonable for some other website to be able to initiate that on the original site's behalf (a premise I'm not personally sold on but let's grant it for the sake of this conversation), why would we limit the second scenario to a(n inscrutable to the user) subset of websites?
Comment by @diekus Jul 15, 2024 (See Github)
Hola @hober, thanks for your feedback, we've been pondering about the implications of navigator.install
for same/cross-origin installations and the requirement of an id
. I've reviewed the current designs for the API and think some changes are needed to warrant consistency between the same/cross origin use case (this is a very valid point you bring up!) and futureproofing the API.
First, we want to make both use cases require an id
. This doesn't have to be a manifest id, it could be any string that the developer uses to identify or refer to the content. If this is a cross-origin scenario for a web app, then highly likely this will be a manifest id. In a same-origin scenario, where there might not even be a manifest present, the developer could call the install method with an arbitrary id
they give their content (i.e. navigator.install('myinstallid123')
). If in the future they wanted to add a manifest file to that (non-app) content, they could do so and use the same string they used as an id
and the app could continue updating without any issues.
This resolves the concern in a way that makes the API consistent independent of the use case (same/cross-origin) and doesn't require the same-origin to-be-installed-content to have a manifest id or to be a web app. We believe it prevents developers from creating a bad app ecosystem as well.
In the case of cross-origin installations, the requirement is to be an installable app and to require a manifest due to bad actor potential and avoiding a bad site to install any URL. This is achieved by opting into the installation sources field, which is present in a manifest file.
cc @amandabaker @dmurph
Comment by @dmurph Jul 15, 2024 (See Github)
In case it's helpful, I modified my earlier proposal here to match what Diego is proposing after we had a discussion. I am in alignment with Diego here, and that doc goes a little more in depth into the use-cases & edge cases here related to supplying an id field.
Discussed
Aug 1, 2024 (See Github)
Peter and Martin are inclined to close this issue as unsatisfied. Thoughts follow...
This whole ID business is distracting. Can we focus on the use case and legitimacy of it, or not?
A site can provide a link to another website. With a same-origin install, a website can initiate an installation. Enough?
The ID of a manifest is a URL. However, that URL is not expected to be resolved, which is weird (note: ask Marcos Caceres why). If it resolved to a manifest, a lot of things would be easier. If it resolves to nothing, that's fine too. The manifest is what is provided to navigator.install() as options.
The presumption here is that trust is a finite resource. People trust a limited number of sites. So in deciding what sites to trust or not, they end up picking just a few. Having an app store as a trusted sites is convenient, because it enables people to broker that trust into multiple app installations from multiple sources. But what power does that confer to the app store over those installations? A mobile app store has a considerable level of control over what apps can or cannot do. They can withdraw an app that violates those terms. This is antithetical to a web that rejects the notion of centralized control.
https://github.com/w3ctag/ethical-web-principles/issues/120 --> https://github.com/w3ctag/ethical-web-principles/issues/120#issuecomment-2272278572
Comment by @diekus Aug 12, 2024 (See Github)
gentle ping, would love to continue with work on Web Install! @hober @torgo
Comment by @diekus Aug 13, 2024 (See Github)
for reference, linking here to developer feedback that is outside of the big browser vendors. There is appetite for this feature, and I find it encouraging that in a thread talking about the web not belonging to anyone, it's actual 3P developers the ones stepping up with signs of support. <3
https://github.com/w3ctag/ethical-web-principles/issues/120#issuecomment-2285348765 https://github.com/w3ctag/ethical-web-principles/issues/120#issuecomment-2285431557
Discussed
Sep 1, 2024 (See Github)
Tess: If we think this is a bad idea, we should lead and trail with "this isn't a great idea", but we can include advice in between.
[Missed some minutes]
Tess: There are lots of things app stores do. Do they make sense as separate APIs? We should try to tease apart the use cases, and evaluate each one.
Tess: If we encourage them at all, are we doing them a disservice?
Martin: It's not them who gets the disservice. It's what it does to the web.
Jeffrey: Note that https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/WebInstall/explainer_cross_domain.md#non-goals includes several of Tess's orthogonal pieces.
Martin to draft a new proposed comment in https://github.com/w3ctag/design-reviews-private-brainstorming/issues/27.
Discussed
Sep 1, 2024 (See Github)
we discuss how this is related to Ethical Web Principle issue 120
we discuss the security characteristcs of apps and how web inherently doesn't need this
we discuss the discoverability use cases
given that the discoverability use case is the key one, is it enough the warrant to the added complexity / potential security issues
Jeffrey: there is the security argument - some web sites are malicious and will trick you into entering your credit card - safe browsing is the thing... user's browser will block sites... a store might do a better job. this API doesn't allow the store to do the better job... One defence for this if it improves security - and it doesn't. This is not a discoverability mechanism... but without it, there is an "extra click". That sounds like a rel attribute to me, "please install this", and then the browser can decide whether or not to do it.
Tess: yes exactly... One counter-argument - why it's an API... a rel attribute value is not gated by user activation... you can cause the link to be followed from script. But the browser could tell and only do the special thing if activation is observed...
Dan: It would be declarative that way.... So yeah... Maybe this would be a good idea?
Tess: rel="install"
Dan: there's another goal, the 'app store' to know whether I've installed it or not and provide a different UX if so
Tess: right now we allow a visual distinction between visited and unvisited links, and sites cannot detect visited link styling so they can't tell if you've gone there or not. There's ane xisting mechanism for us to do something different for different kinds of links on the page. The browser could know. Different pages which link to the same app should not know that I instaslled it from somewhere else. But arguement to expose it to the original page
Dan: other goals - they want to track the fact you installed and report back
Tess: it's clear a rel="install" doesn't get you everything that the API gets you. We could do a styling thing to visually distinguis (I don't think it's a good idea). Tradeoffs. If a rel="install" gets you 80% of what you want simply and declarative
Dan: wondering if web app scope extensions could help in some way. Same people. Bidirectional agreement between origins. If we say we don't think they should be able to do cross origin installation, but if they used this declarative appraoch and there was a bidirectional agreement between the parties. You could do that out of band.
Tess: something in the web manifest, which is more or less what they already had. Also rev
.
Dan: if I follow a link that says rel="install" because of the referer header it will know where the link came from.
Tess: you don't even need to rely on that. If you want to require an opt in what you would probably do is just fetch the manifest immediately. Could prefetch the manifest for every link on the page
Dan: a way to achieve all their goals without building a whole new api
Tess: it doesn't handle the payment and conversion tracking cases. In the same origin case .. in safari and macos you can add to dock any website. User doesn't care about the manifest. Weird disconnect between same origin and cross origin. Cross origin requires a bunch of infrastructure. There's an arguement for it, but if yo've already adopted the same origin install api on your own site and someone reaches out to include the app.. the hoops to do that are a lot. A rel install wouldn't require those extra hoops.. it's a bonus, but..
Dan: The browser is going to that place where the app is, which it needs to do anyway. The delivery of the code is not centralised.
Tess: the UI flow in the browser for a rel install could be streamlined; a double opt in from both sides. If there's no opt in the browser might get more in your face to the user about whether they want to do it.
Jeffrey: will write notes into issue. We may want to invite them to talk to us directly.
Proposed comment: https://github.com/w3ctag/design-reviews-private-brainstorming/issues/27#issuecomment-2339370537
Discussed
Sep 1, 2024 (See Github)
Jeffrey: I think there's nothing to discuss this week...
Peter: Ok let's punt...
Jeffrey: to talk to the WICG folks about including it in the discussion at TPAC
Comment by @jyasskin Sep 12, 2024 (See Github)
Thanks for bearing with us. Looking at this proposal again from first principles, it seems like a way to reduce the friction between discovering an app and installing it. The web doesn't need any new APIs for someone to build an application repository to search for apps; that's just a filter in a search engine. We don't need a new API to let someone curate the results in such a search engine according to their current trustworthiness. Without this proposal, the quickest route from an app-search results page to installing an app seems to be:
- User clicks the result.
- Landing page presents an "Install me" button. (The landing page can't just request an installation dialog because of the gesture requirement of the same-origin
navigator.install
). - User clicks the "Install me" button.
- Browser presents the installation dialog.
With this proposal, a browser could eliminate the middle two steps:
- User clicks the result.
- Browser presents the target app and an installation dialog.
The TAG is split on whether that's potentially an improvement, with a majority thinking it isn't. Given that any given app is installed just once in its lifetime, one click is not a high price. There are several benefits to that: installation is controlled by the origin that will be installed, it doesn't require the creation of a bunch of machinery, and the installation is both attributable and accountable to the correct entity. If you think we need to eliminate that click, your explainer should present some supporting evidence.
If you persist here, and you have UI in mind to deal with all of those issues, we think that a declarative model is likely to work better than the current imperative proposal. You identified a link attribute in your Alternatives Considered section, but maybe a new link relation type would work better than a new target
keyword. That gives user agents some flexibility in terms of how they handle the request to install, from just ignoring it and navigating, to doing something more actively.
It is not clear to us why sites need to be able to control which stores can install them. This is the most centralizing aspect of the proposal: if a newly-created store needs to get the approval of hundreds of apps before it can be a viable store, you've created a moat around the incumbents. What would make that necessary in this model?
The proposed navigator.getInstalledApps()
sounds plausible on its face, but there are some unresolved issues. It could be awkward when (for privacy reasons) a store shows an app as not-yet-installed even though the user installed it directly or via a different store. But there's a more serious privacy issue in telling stores whether an app has later been uninstalled: how can users be adequately informed about who's getting that information? It's not clear that the cross-origin signal there is justified. Keying off DNT/GPC seems like the wrong tool to use as those relate to something orthogonal. If there's a good justification for exposing uninstallation information, a mechanism like :visited
, which exposes 1 target at a time, might be better than the full list returned by the current proposal.
The TAG remains conflicted on this proposal. A number of us are firmly of the view that this feature is unnecessary, both in terms of its justification and in terms of the cost. While that is the prevailing view, others are looking to find ways to enable browser experimentation that minimize the potential harm, especially to users and browsers that don't adopt this change.
Overall, we'd prefer to see this not go ahead at all, but if it does, we'd like to keep talking through the above options or others that might reduce the potential harm.
Comment by @slightlyoff Sep 12, 2024 (See Github)
There seems to be some confusion in this thread.
Some folks seem to be conflating browser-facilitated prompting based on browser quality signals with user-initiated flows that come from browser UI. Browsers that support browser-facilitated prompting have long required quality gates, including conformant manifests. The proposal here is explicitly to extend that system to cross-origin prompting.
Browsers that don't provide any sort of developer-facilitated and controlled prompting are a long way from getting any value from navigator.install()
, and my suggestion would be that they start by implementing the onbeforeinstallprompt
analogue for "Smart Banners"
(which require a great deal of developer work, including a stable ID) based on explicit developer signals and quality gates; manifests are a good first-step there.
It only really makes sense for browsers that support developers in promoting their web apps on the same origin to extend that support to cross-origin cases with navigator.install()
. Hopefully the TAG can recognise that the UI differences between browser-enhanced promotion and user-initiated, buried UI surfaces material to the success of install rates (as has been continually proven in PWA-supporting browser's data) and therefore categorically different in developer intent and need for API surface area.
Discussed
Oct 1, 2024 (See Github)
Waiting on proponents.
Discussed
Oct 1, 2024 (See Github)
We spoke at TPAC and there is no new information.
Discussed
Nov 1, 2024 (See Github)
Jeffrey: we posted our comments, slightlyoff objected, and we had a good discussion at TPAC
tess: no record of that in the issue though?
Martin: I think we should close unsatisfied
Jeffrey: we can do that.
Tess: can we link to the conversation at TPAC?
Jeffrey: we could, but the most useful conversation was at lunch afterwards
Martin: the minuted discussion focused on one of the minor issues. I wasn't at lunch.
Jeffrey: it was mostly explaining our comment.
Hadley: so what do we do with this issue?
Tess: we close it.
Jeffrey: yes.
Peter: without comment?
Jeffrey: no, say "when there are answers to the questions we asked above,..."
Peter: sounds good.
Comment by @jyasskin Nov 20, 2024 (See Github)
Thanks for the discussion at TPAC. We're going to close this review for now, although feel free to re-open it once you've updated the explainer to deal with some of the concerns described above, and you're ready for us to re-review it.
OpenedApr 15, 2024
Hola TAG! I'm requesting an early TAG review of the Web Install API.
The Web Install API allows a web site to install a web app (cross domain). This functionality allows the creation of web based catalogues that can install PWAs directly from the web and into multiple platforms.
Further details:
You should also know that...
there's plenty of positive developer feedback for an API like this one!