From 4c24e73b3013316b9f39d196bca2eb8867027e6a Mon Sep 17 00:00:00 2001
From: Aaron Gustafson
@@ -2403,6 +2408,102 @@
manifest["serviceworker"], manifest URL,
and serviceworker.
+
shortcuts
member given
+ manifest URL, and "shortcuts"
.
+
ServiceWorkerRegistrationObject serviceworker;
sequence<ExternalApplicationResource> related_applications;
boolean prefer_related_applications = "false";
+ sequence<ShortcutItem> shortcuts;
};
can get their games and apps rated with IARC.
shortcuts
member
+ + The shortcuts member is an array of + ShortcutItems that provide access to key tasks within a web + application. +
++ Shortcuts could, for instance, be used to link directly to a user's + timeline within a social media application or to their recent orders + in an e-commerce context. +
++ How shortcuts are presented, and how many of them are shown to the + user, is at the discretion of the user agent and/or operating system. +
++ Developers are encouraged to order their shortcuts by priority, with + the most critical shortcuts appearing first in the array. +
+
+ The steps for processing the shortcuts
member
+ are given by the following algorithm. The algorithm takes a
+ sequence<ShortcutItem>
+ shortcuts as an argument. This algorithm returns an
+ sequence<ShortcutItem>. For
+ each shortcut (ShortcutItem) in the sequence, set
+ shortcut.icons to the result of running processing
+ `ImageResource` members given shortcut.icons and
+ manifest URL. For each shortcut
+ (ShortcutItem) in the sequence, parse
+ shortcut["url"] using manifest URL as
+ the base URL.
+
+ A user agent SHOULD expose shortcuts via interactions that are + consistent with exposure of an application icon's context menu in the + host operating system (e.g., right click, long press). A user agent + SHOULD render the shortcuts in the same order as they are provided in + the manifest. A user agent SHOULD represent the shortcuts in a manner + consistent with exposure of an application icon's context menu in the + host operating system. A user agent MAY truncate the list of + shortcuts presented in order to remain consistent with the + conventions or limitations of the host operating system. +
++ In the following example, the developer has included two shortcuts. + Assuming the the manifest's URL is + https://example.com/manifest.webmanifest: +
++ { + "shortcuts": [ + { + "name": "Play Later", + "description": "View the list of podcasts you saved for later", + "url": "/play-later", + "icons": [ + { + "src": "/icons/play-later.svg", + "type": "image/svg+xml", + "purpose": "any" + } + ] + }, + { + "name": "Subscriptions", + "description": "View the list of podcasts you listen to", + "url": "/subscriptions?sort=desc" + } + ] + } ++
+ dictionary ShortcutItem { + required USVString name; + USVString short_name; + USVString description; + required USVString url; + sequence<ImageResource> icons; + }; ++
+ Each ShortcutItem represents a link to a key task or page within + a web app. A user agent can use these values to assemble a context menu + to be displayed by the operating system when a user engages with the + web app's icon. When the user invokes a shortcut from the operating + system menu, the user agent SHOULD run Launching a shortcut. +
+name
member
+ + The name member of a ShortcutItem is a + string that represents the name of the shortcut as it is + usually displayed to the user in a context menu. +
+short_name
member
+ + The short_name member of a ShortcutItem is a + string that represents a short version of the name of the + shortcut. It is intended to be used where there is insufficient space + to display the full name of the shortcut. +
+description
member
+ + The description member of a ShortcutItem is a + string that allows the developer to describe the purpose of + the shortcut. User agents MAY expose this information to assistive + technology. +
+url
member
+ + The url member of a ShortcutItem is the URL + that opens when the associated shortcut is activated. +
++ The icons member of an ShortcutItem member is an + array of ImageResources that can serve as iconic + representations of the shortcut in various contexts. +
++ When ShortcutItem shortcut having + WebAppManifest manifest is invoked, run the + following steps: +
+