Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the W3C Web App Manifest (and Add to Homescreen/Desktop) #15505

Open
cvan opened this issue Feb 11, 2017 · 0 comments
Open

Support the W3C Web App Manifest (and Add to Homescreen/Desktop) #15505

cvan opened this issue Feb 11, 2017 · 0 comments

Comments

@cvan
Copy link

@cvan cvan commented Feb 11, 2017

It would be nice to have Servo parse W3C Web App Manifests and Add to Homescreen (or Desktop/Applications/Dock).

Web-app developers today are using manifests by adding to their HTML documents a tag: <link rel="manifest" href="manifest.webmanifest">. And in the manifest.webmanifest is a JSON blob of some useful metadata (see this example).

A powerful feature enabled by manifests is the ability to "install" manifests to a user's homescreen/desktop. Per the spec, the UA can decide how to design the experience of discovery + installation, as well as the filesystem/OS integration (for installing and launching).

Here are some useful resources on manifests and the current support:

And some useful links on "Add to Homescreen" support (using manifests):

Here's an overview of the current browser support:

  • Chrome for Android: "Add to Homescreen" installs an Android .apk on the phone that's really just a shortcut to launch Chromium as a "progressive web app" (PWA) from a particular URL (i.e., the start_url in the manifest) with a particular display mode (e.g., standalone, browser, etc.) - and boot from a Service Worker, etc. (The .apk also has an Android Intent manifest, which intercepts any URLs on the system if they get loaded and match the scope for the installed web app.)
  • Chrome for desktops & Chromebooks: "Add to shelf" experimental support (behind a chrome://flags/#enable-add-to-shelf flag). With ATS, a native app gets installed in the user's Applications directory (based on the OS). The application is just a tiny executable that launches Chrome at a particular URL for that web app.
  • Microsoft Edge: Evidently (from talking to a developer on the Edge team), there's some level of support of "Add to Desktop" (but I've not been able to figure out how to enable it or found any video of this).

In Chrome for Android, on a web app, users have the ability to manually "Add to Homescreen" (watch this video of the user flow). In addition to manually adding/pinning a site, with Chrome for Android's ATH and desktop Chrome's experimental ATS support, Chrome has set these default requirements and "user-engagement" heuristics for whether to automatically show a prompt to the user:

  • Manifest must contain a loadable start_url (served on the same origin; if not supplied, defaults to /index.html)
  • Manifest must contain a valid display (valid display modes are fullscreen, standalone, minimal-ui, browser)
  • Site must be served from HTTPS
  • Site must register a valid Service Worker (even if it's empty, heh)
  • User must have spent at least five minutes on the site for two or more sessions

I know this is information overload, but I figured I'd type this all up for any future dev who is interested in potentially adding first-class web-app manifest+launcher support to Servo. Especially on the desktop, there are some very compelling opportunities to provide the ability to launch web apps (e.g., games, PWAs, and hybrid apps [e.g., Slack, Spotify, Ghost, Atom, Visual Studio Code, etc.] come to mind that are currently being packaged as Electron apps and distributed through app stores).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.