diff --git a/index.html b/index.html index 26cf484..d5b0686 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,7 @@ "file-system-access", "fs", "mimesniff", + "urlpattern", "web-app-launch", "window-controls-overlay" ], @@ -92,14 +93,20 @@
This member is intended to be only used for advanced cases, where the developer wants explicit control over the fallback order of their - display modes. Otherwise, the [=manifest/display=] member is sufficient - for most use cases. + display modes, or for modes that are not available in the basic + display modes + list. Otherwise, the [=manifest/display=] member is sufficient for + most use cases.
tab_strip
member
+ + The `tab_strip` member of the Web Application Manifest is + an object that contains + information about how the application is intended to behave in the + [=display mode/tabbed=] display mode. It has the following members: +
+home_tab
member
+ + The `home_tab` member of the [=tab_strip=] object is an ordered map + that contains information about a special "home tab" that is intended + to serve as the top-level menu for the application. It contains the + following members: +
+
+ The scope_patterns
member is a list of
+ {{URLPatternInput}}s that define the [=within home tab scope|scope of
+ the home tab=] relative to the [=manifest URL=].
+
+ An application has a home tab if the applied [=display + mode=] of the application is [=display mode/tabbed=], and the + [=Document/processed manifest=] includes a non-null [=home_tab=] + member of the [=tab_strip=] member. +
++ The home tab context is an optional [=application + context=] that has special properties compared to other application + contexts. If the application [=has a home tab=], every application + window SHOULD feature a [=home tab context=]. If not, then the + application windows SHOULD NOT have a [=home tab context=]. +
++ How the [=home tab context=] is presented is at the discretion of the + user agent, but it SHOULD have a different appearance to normal + application contexts. +
++ A [=URL=] |url:URL| is said to be within home tab scope if + and only if: +
++ A URL is is outside of home tab scope if it is not + [=within home tab scope=]. +
+ ++ If the application [=has a home tab=], whenever a new application + window is created (for example when launching the application, or + when moving a tab to a new window), the user agent MUST create a + new [=home tab context=] in that window. A newly created [=home tab + context=] SHOULD be navigated to the [=start URL=], which by + definition is [=within home tab scope=]. +
++ When [=navigate|navigating=] the [=top-level traversable=] + associated with a [=home tab context=] to a [=URL=] |url:URL| that + is [=outside of home tab scope=], the following steps are run: +
+"_blank"
and noopener true.
+ + When [=navigate|navigating=] a [=top-level traversable=] with a + [=display mode=] of [=display mode/tabbed=] that is not associated + with a [=home tab context=] (i.e. a non-home tab) to a [=URL=] + |url:URL| that is [=within home tab scope=], the following steps + are run: +
++ The above rules are intended to ensure that the following + invariants are always true, for applications that [=has a home + tab|have a home tab=]: +
++ User agents will not dynamically move documents between home-tab + and non-home-tab contexts if they change their [=URL/fragment=], or + use the {{History}} API to modify their display URL into or out of + the home tab scope, because no navigation is taking place. For this + reason, the above invariants only care about the [=Document/URLs=] + that documents had at the time of their creation. +
++ For single-page applications that "pretend" to navigate by + modifying their URLs, this may result in undesirable behaviour that + breaks the above invariants (e.g. if the user clicks a link from + the home tab to dynamically change the URL to a non-home page, they + will stay inside the home tab because it is not actually + navigating). To avoid this situation, the application can detect + when it is in tabbed application mode and change its behavior to + perform actual navigations into and out of the home tab scope, + rather than modifying the URL. +
+new_tab_button
member
+ + The [=tab_strip/new_tab_button=] member is an ordered map that + describes the behaviour of a UI affordance (such as a button) which, + when clicked/activated, opens a new [=application context=] within + the application window. It has the following members: +
+
+ The url
member
+ is a string that represents a URL relative to the [=manifest URL=]
+ that is [=manifest/within scope=] of a [=Document/processed
+ manifest=].
+
+ An application has a new tab button if the + [=Document/processed manifest=]'s [=new_tab_button=]'s + [=new_tab_button/url=] member is [=outside of home tab scope=]. If + the application does not [=has a new tab button|have a new tab + button=], the user agent SHOULD NOT make the "new tab" affordance + available to the end user. +
+ ++ When the new tab button is activated by the end user, the following + steps are run: +
++ To process the `tab_strip` member, given [=ordered map=] + |json:ordered map|, [=ordered map=] |manifest:ordered map|, and + [=URL=] |manifest URL:URL|, run the following during the + + extension point in [=processing a manifest=]: +
++ To process the `home_tab` member, given [=ordered map=] + |json tab strip:ordered map|, [=ordered map=] |manifest tab + strip:ordered map|, and [=URL=] |manifest URL:URL|, run the + following: +
++ To process the `new_tab_button` member, given [=ordered + map=] |json tab strip:ordered map|, [=ordered map=] |manifest tab + strip:ordered map|, [=URL=] |manifest URL:URL|, and [=URL=] |start + URL:URL|, run the following: +
++ To process the `scope_patterns` member, given [=ordered + map=] |json home tab:ordered map|, [=ordered map=] |manifest home + tab:ordered map| and [=URL=] |manifest URL:URL|, run the following: +
++ { + "name": "Tabbed App Example", + "start_url": "/", + "display": "standalone", + "display_override": ["tabbed"], + "tab_strip": { + "home_tab": { + "scope_patterns": [ + {"pathname": "/"}, + {"pathname": "/index.html"} + ] + }, + "new_tab_button": { + "url": "/create" + } + } + } ++
+ This example is a tabbed web app that falls back to a single-document
+ standalone window if tabbed mode is not supported. Any navigation to
+ the main index page (either /
or
+ /index.html
) is opened in the [=home tab context=]. The
+ new tab button will open a new tab at /create
.
+
+ Note that the [=URL/query=] part of the URL is ignored by default
+ when matching against [=tab_strip/home_tab/scope_patterns=] (so a
+ navigation to /index.html?utm_source=foo
will open in
+ the home tab). However, when matching against [=start URL=], the
+ [=URL/query=] must match exactly, so sites that want to ignore the
+ query are advised to explicitly include the [=start URL=]'s
+ [=URL/path=] as a scope pattern.
+