Closed dfabulich closed 1 year ago
+1. We're looking into the implications of this. It'd be nice to have one consistent ergonomic API that would cover both installation types (same and cross domain).
We'd be keeping the same threshold of onbeforeinstallprompt
for navigator.install()
same domain installs, but plan at phasing out the former for the latter. Do let me know your thoughts, and if everything seems alright I'll proceed to close this issue.
onbeforeinstallprompt
has always had a weirdness in its API: you have to store a reference to theonbeforeinstallprompt
event and use that event object to initiate the prompt.Code sample from MDN:
It would be nice if
navigator.install()
would do the right thing for same-origin installation as well, perhaps with no URL parameter in that case. That could change the sample to: