Author: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Copyright © 2017 Akihiko Odaki. Licensed under CC0 1.0.
This specification describes URL scheme to declare it is Activity Streams 2.0.
This draft is written to implement intent feature in Mastodon, an Activity Streams implementation.
This section describes the status of this document at the time of its publication. Other documents may supersede this document.
This document was published by the author as a proposal for Mastodon
and other Activity Streams applications. Please write comments
regarding this document to the following issue in Mastodon:
URL scheme
for remote follow, share buttons · Issue #2291 ·
tootsuite/mastodon
This document is expected to be useful also for other Activity Streams applications. If you have any request to change for them, please contact the author. E-mail is the most reliable means for that, but OStatus2 is also acceptable. Send a note to @fn_aki@pawoo.net.
Chromium is a popular Web browser, and provides to implement a custom protocol handler for some URL schemes. This defines a URL scheme specific to Activity Streams 2.0 to take advantage of the feature.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", " SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
web+activity+data
URL SchemeAll of the requirements data
scheme listed in
[RFC2397] are also requirements for web+activity+data
scheme, except that it is explicitly declared to be an Activity
Streams representation and <mediatype> defaults to
application/activity+json;charset=UTF-8
if it is
omitted. As a shorthand, application/activity+json
can be
omitted but the charset parameter supplied.
web+activity+https
URL SchemeAll of the requirements for https
scheme listed in
[RFC7230], Section 2.7.2 are also requirements for the
web+activity+https
scheme, except that it is explicitly
declared to be an Activity Streams representation, and the user agent
MUST set
application/ld+json; profile="https://www.w3.org/ns/activitystreams"
for the Accept
header field defined in [RFC7231], Section
5.3.2.
The syntax is specified using the following [ABNF] syntax description.
authority = <authority, see [RFC3986], Section 3.2>
path-abempty = <path-abempty, see [RFC3986], Section 3.3>
query = <query, see [RFC3986], Section 3.4>
fragment = <fragment, see [RFC3986], Section 3.5>
web-activity-https-URI = "web+activity+https:" "//" authority
path-abempty [ "?" query ]
[ "#" fragment ]
This section is non-normative.
The main use case of schemes defined in this specification is to allow more Web browsers to have a custom handler. If writing a URL of Activity Streams representation for public and it is intended to be processed by Activity Streams applications, the link SHOULD use those schemes for better compatibility.
If the URLs are intended to be processed by a generic application
rather than Activity Streams applications, the link SHOULD NOT use
schemes defined in this specification. For example, if a URL is
specified as href
attribute of a
element with truthy download
attribute, its scheme
SHOULD be https
rather than
web+activity+https
. Here, href
attribute,
a
element and download
attribute are
specified in [HTML5].
This section is non-normative.
If a consumer of URLs understands web+activity+data
scheme, it SHOULD understand data
scheme for the same
purposes to achieve interoperability.
If a consumer of URLs understands web+activity+https
scheme, it SHOULD understand https
scheme for the same
purposes to achieve better interoperability.
This section is non-normative.
A public provider of schemes defined in this specification SHOULD advertise the use of the schemes for potential consumers.
This section is non-normative.
A scheme corresponding to http
scheme is not defined in
this document and URLs such a scheme SHOULD NOT be used to deliver
them to public.