App Scheme

Paul Frazee edited this page Sep 22, 2017 · 4 revisions

The app:// scheme is a user-configurable namespace for sites & applications. It allows users to "install" dat:// sites into specific shortnames.

Anybody is free to publish a site to a specific shortname. Users are then free to choose which app is the default. As a result, the site loaded for a app:// URL will differ from user to user.

Some example addresses: app://mail, app://photos, app://social, app://software-news

Motivation

Beaker's mission is to foster a user-first Web, where app development is driven from the bottom up. The app:// scheme furthers this mission by putting URL resolution in the hands of the users.

Rather than create a single registry of canonical names as with DNS, we let sites compete for the mapping. Social ranking and personal choice will drive the most popular software to dominate the names. The need to interoperate will push developers to collaborate on URL specs and APIs.

Mechanics

App Name Rules

App names must pass this regex: [a-z][a-z0-9-]*. Names are case-insensitive. Periods are not allowed, so that app-names are less commonly confused with DNS-issued hostnames.

Name -> App Resolution

Each browser maintains an internal registry of names assigned by the user. At this time, only sites served over dat:// can be assigned to app:// names.

If the user attempts to open an app-scheme URL with no current mapping, the browser will redirect to the app-find-url, app://find?name={name}&redirect_url={url}. This application should direct the user to make the choice for a new mapping, update the registry, then redirect the user to the original destination. The find application includes a builtin fallback, so that the user will never be given a 404 without recourse.

A button in the browser UI allows the user to automatically redirect to the app-find-url for the current app:// page, so that they can select a new mapping.

App Registration

Dat sites register their interest in an app-name by including an app entry in their dat.json manifest.

{
  "title": "My Mail App",
  "description": "Read and write electronic mails",
  "app": {
    "name": "mail"
  }
}

Currently the only value in the app object is the name.

Registration API

TODO It will be necessary for applications (especially app://find) to read and write the local registry.

Application Specs

app://find

A general purpose search & lookup application. May serve many kinds of searches, but currently used by the browser to locate sites which are available for the given name. May read from the local browser APIs, and/or from one or more services.

URL specs

  • the "app-find-url": app://find?name={name}&redirect_url={url}
    • name - the shortname of the application
    • url - the full URL to return to after a decision
You can’t perform that action at this time.
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.
Press h to open a hovercard with more details.