- Because scopes are based on URL matching, it is possible for a
- developer to create multiple web applications with the same,
- overlapping, or nested scopes. Doing so creates several issues
- (detailed below) and is thus considered bad practice.
+ Because scopes are based on URL matching, it is possible for a developer to create
+ multiple web applications with the same, overlapping, or nested scopes. Doing so creates
+ several issues (detailed below) and is thus considered bad practice.
+
+
The scopes of the two web apps can be on the same origin. Not
+ recommended.
+
+
The scope of one web app can be nested inside the scope of the
+ other. Strongly not recommended.
+
+
The scopes of the two web apps can be the same. Strongly not
+ recommended.
+
+
Same-origin scopes are not recommended due to origin-based settings
that will affect all apps installed under that origin. Settings like:
@@ -2567,49 +2577,28 @@
Storage and storage quota
-
User settings (e.g. font size, zoom level)
+
User settings (e.g. font size)
- To aide with disambiguation apps with scope conflicts, user agents
- can determine the controlling app for a given document
- URL, which is an [=installed web application=] with the longest
- [=manifest/scope=] where the document url is [=manifest/within
- scope=] of that application. If multiple apps fit this description
- (in the case of matching scopes), then the user agent may choose
- none, one, or all, depending on the scenario.
-
-
- The following scenarios may require the user agent choosing a
- [=controlling app=], not work, or be unpredictable with nested or
- matching scopes:
+ Further, overlapping, nested, or duplicate scopes can have the following UX and
+ API problems or inconsistencies among other possible consistencies:
-
Installation prompting.
+
Installation prompting may not work for the nested app if the
+ outer app is installed.
-
User-agent UX around launching an app for a browsing context.
+
User-agent UX around launching an app for a browsing context may
+ be inconsistent or not appear.
-
Notifications and notification attribution.
+
Badging API calls will not be able to consistently update the
+ correct web app badge.
-
And current or future APIs that somehow correspond to a single web app identity
- (e.g. badging).
+
Notifications may have incorrect attribution or not appear.
+
+
Future APIs may not work at all in this configuration.