-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
2148 lines (2143 loc) · 84.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Manifest Incubations
</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class=
"remove"></script>
<script class='remove'>
// See https://github.com/w3c/respec/wiki/ for how to configure ReSpec
var respecConfig = {
specStatus: "CG-DRAFT",
editors: [{
name: "Daniel Murphy"
}],
group: "wicg",
github: "WICG/manifest-incubations",
shortName: "manifest-incubations",
xref: {
specs: [
"appmanifest",
"dom",
"file-system-access",
"fs",
"mimesniff",
"urlpattern",
"web-app-launch",
"window-controls-overlay"
],
profile: "web-platform",
},
};
</script>
</head>
<body data-cite="MEDIAQUERIES-5">
<section id="abstract">
<p>
Feature specifications for <a href=
"https://www.w3.org/TR/appmanifest/">Web Application Manifest</a>
extensions & incubations which Chromium has shipped but do not have
committments / implementations from other user agents. Instead of
keeping these features as explainers, they are documented more
officially here.
</p>
</section>
<section id="sotd">
<p>
This is an unofficial proposal.
</p>
</section>
<section>
<h2>
<code><dfn data-export="" data-dfn-for=
"manifest">display_override</dfn></code> member
</h2>
<p>
For advanced usages, the [=manifest/display_override=] member can be
used to specify a custom fallback order of <a data-cite=
"appmanifest#dfn-display-modes-list">display mode list values</a> for
developers to choose their preferred <a data-cite=
"appmanifest#dfn-display">display mode</a> for the web application. Its
value is a [=display mode=].
</p>
<p>
The [=manifest/display_override=] member of the [=application
manifest=] is a <a>sequence</a> of <a data-cite=
"appmanifest#dfn-display-modes-list">display mode list values</a>
including extensions like [=display mode/window-controls-overlay=] and
[=display mode/borderless=]. This member represents the developer's
preferred fallback chain for [=display mode=]s. This field overrides
the [=manifest/display=] member. If the user agent does not support any
of the [=display mode=]s specified here, then it falls back to
considering the [=manifest/display=] member. See <a data-cite=
"appmanifest#dfn-process-the-display-member">processing the display
members</a> for the algorithm steps.
</p>
<p>
The following steps are added to the [=application manifest/processing
extension-point=] in <a data-cite=
"appmanifest#dfn-steps-for-determining-the-web-app-s-chosen-display-mode">
determining the web app's chosen display mode</a>:
</p>
<ol>
<li>[=list/For each=] |candidate_display_mode:DisplayModeType| of
|manifest:ordered map|.[=manifest/display_override=] member:
<ol class="algorithm">
<li>If <a data-cite="appmanifest/#dfn-display-modes-list">display
modes list</a> contains |candidate_display_mode:DisplayModeType|,
return that |candidate_display_mode:DisplayModeType|
</li>
<li>If |candidate_display_mode:DisplayModeType| is [=display
mode/window-controls-overlay=] and the user agent supports this,
then return that |candidate_display_mode:DisplayModeType|.
</li>
<li>If |candidate_display_mode:DisplayModeType| is [=display
mode/tabbed=] and the user agent supports this, then return that
|candidate_display_mode:DisplayModeType|.
</li>
</ol>
</li>
</ol>
<p class="note">
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, or for modes that are not available in the basic
<a data-cite="appmanifest/#dfn-display-modes-list">display modes
list</a>. Otherwise, the [=manifest/display=] member is sufficient for
most use cases.
</p>
<section>
<h3>
Concepts
</h3>
<ul>
<li>
<dfn data-lt="controls of the window">Window controls</dfn>:
interface elements that the operating system uses consistently
across applications to enable the user to perform certain actions
to control the application. Common actions in the [=window
controls=] include minimize, maximize/restore, and close buttons.
</li>
</ul>
</section>
<section>
<h3>
Display mode extensions
</h3>
<p>
Additionally to the normal <a data-cite=
"appmanifest#dfn-display-modes-list">display modes</a>,
[=manifest/display_override=] also supports certain extensions to it.
</p>
<dl>
<dt>
<dfn data-export="" data-dfn-for="display mode">borderless</dfn>
</dt>
<dd>
The web application does not have any host-native title bar or
[=window controls=] visible and with the web contents extended to
the whole title bar area. The app can specify [=draggable region=]s
in the web contents to create a customized title bar. The user
agent may change the title bar state depending on various security
considerations, like an out-of-scope navigation.
</dd>
<dt>
[=display mode/window-controls-overlay=]
</dt>
<dt>
<dfn data-export="" data-dfn-for="display mode">tabbed</dfn>
</dt>
<dd>
The web application can have multiple [=application contexts=]
combined in a single operating-system-level window. For example,
this could mean the user agent displays a tab strip UI to allow the
user to switch between the application contexts.
</dd>
</dl>
<section class="informative">
<h4>
[=manifest/display_override=] usage example
</h4>
<p>
The following shows a [=manifest=] that prefers the
<code>minimal-ui</code> <a data-cite=
"appmanifest#dfn-display-mode">display mode</a> over
<code>standalone</code>, but if <code>minimal-ui</code> isn't
supported, falls back to <code>standalone</code> as opposed to
<code>browser</code>.
</p>
<pre class="example json" title="display_override usage manifest">
{
"name": "Recipe Zone",
"description": "All of the recipes!",
"icons": [{
"src": "icon/hd_hi",
"sizes": "128x128"
}],
"start_url": "/index.html",
"display_override": ["minimal-ui"],
"display": "standalone",
"theme_color": "yellow",
"background_color": "red"
}
</pre>
</section>
</section>
<section>
<h3>
Defining <dfn data-export="" data-lt="draggable region">draggable
regions</dfn>
</h3>
<p class="issue" title="At risk feature">
[=app-region=] CSS property has not been implemented in any user
agent, so it is at risk. Note that some user agents use the
non-standard CSS property <dfn data-export="" data-lt=
"-webkit-app-region">`-webkit-app-region`</dfn> for the same purpose.
</p>
<p>
The <dfn data-export="" data-lt="app-region">`app-region`</dfn>
property can be used to define with CSS which regions or elements in
for example a title bar are draggable.
</p>
<ul>
<li>To enable dragging an element, shall be set to `drag`.
</li>
<li>To disable dragging an element, shall be set to `no-drag`.
</li>
</ul>
</section>
</section>
<section>
<h2>
Extensions to processing the manifest
</h2>
<p>
To facilitate all of the new extension and incubation features added by
this specification, the user agent SHOULD run the following during the
<a data-cite=
"appmanifest#dfn-processing-extension-point-of-web-manifest">extension
point</a> in [=processing a manifest=] (having access to [=URL=]
|document URL:URL|, [=URL=] |manifest URL:URL|, [=ordered map=]
|json:ordered map|, and [=ordered map=] |manifest:ordered map|):
</p>
<ol>
<li>[=Process the `tab_strip` member=], passing |json|, |manifest| and
|manifest URL|.
</li>
<li>[=Process the `note_taking` member=], passing |json|, |manifest|
and |manifest URL|.
</li>
<li>[=Process the `protocol_handlers` member=], passing |json| and
|manifest|.
</li>
<li>[=Process the `file_handlers` member=], passing |json|, |manifest|
and |manifest URL|.
</li>
<li>[=Process the `related_applications` member=], passing |json| and
|manifest|.
</li>
</ol>
</section>
<section>
<h2>
<code><dfn>tab_strip</dfn></code> member
</h2>
<p>
The `tab_strip` member of the <a data-cite=
"appmanifest#web-application-manifest">Web Application Manifest</a> is
an <a data-cite="appmanifest#dfn-object">object</a> that contains
information about how the application is intended to behave in the
[=display mode/tabbed=] display mode. It has the following members:
</p>
<ul>
<li>[=tab_strip/home_tab=]
</li>
<li>[=tab_strip/new_tab_button=]
</li>
</ul>
<section>
<h3>
<code><dfn>home_tab</dfn></code> member
</h3>
<p>
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:
</p>
<ul>
<li>[=home_tab/scope_patterns=]
</li>
</ul>
<p>
The <code><dfn>scope_patterns</dfn></code> member is a list of
{{URLPatternInput}}s that define the [=within home tab scope|scope of
the home tab=] relative to the [=manifest URL=].
</p>
<aside class="note">
Each scope pattern is either a string which looks like a URL but has
"<code>*</code>" as a wildcard character, or a dictionary containing
separate URL components with "<code>*</code>" wildcards. See
[[urlpattern]] for more information.
</aside>
<p>
An application <dfn>has a home tab</dfn> 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.
</p>
<p>
The <dfn>home tab context</dfn> 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=].
</p>
<p>
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.
</p>
<p>
A [=URL=] |url:URL| is said to be <dfn>within home tab scope</dfn> if
and only if:
</p>
<ul>
<li>the application [=has a home tab=], and
</li>
<li>|url| is [=manifest/within scope=] of the manifest, and
</li>
<li>at least one of the following:
<ul>
<li>|url| [=URL/equals=] the [=start URL=], with
[=URL/equals/exclude fragments=] set to true, or
</li>
<li>Applying [=URL pattern/match=] given any element of the
[=scope_patterns=] member of the [=home_tab=] member of the
[=tab_strip=] member of the [=Document/processed manifest=] and
|url| returns a {{URLPatternResult}}.
</li>
</ul>
</li>
</ul>
<p>
A URL is is <dfn>outside of home tab scope</dfn> if it is not
[=within home tab scope=].
</p>
<aside class="note">
<p>
The "home tab scope" (i.e., the set of [=URLs=] which are [=within
home tab scope=]) is the set of URLs to which the [=home tab
context=] can be navigated . All navigations within the application
to a URL [=within home tab scope=] will be performed in the [=home
tab context=], and all navigations to a URL [=outside of home tab
scope=] will be performed in a different [=application context=]
(i.e., another tab), creating one if necessary. The application's
[=start URL=] is always part of the home tab scope (if the
application [=has a home tab=]).
</p>
<p>
For the purpose of matching against the [=start URL=], the
[=URL/fragment=] is ignored, but the [=URL/query=] must match
exactly.
</p>
<p>
If the application does not [=has a home tab|have a home tab=],
then the home tab scope is the empty set, and all URLs are
[=outside of home tab scope=].
</p>
</aside>
<section>
<h3>
Every window has a home tab
</h3>
<p>
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=].
</p>
</section>
<section>
<h3>
Navigations concerning the home tab scope
</h3>
<p>
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:
</p>
<ol>
<li>Let [=top-level traversable=] |tab:toplevel traversable| be the
result of choosing a navigable with a target of
<code>"_blank"</code> and noopener true.
</li>
<li>Instead of [=navigating=] the home-tab traversable,
[=navigate=] |tab| with the same parameters.
</li>
<li>[=applied|Apply=] the current [=application manifest=] to
|tab|'s [=top-level browsing context=].
</li>
<li>The user agent SHOULD place |tab| in the same window as the
home-tab navigable.
</li>
<li>Focus |tab|.
</li>
</ol>
<p class="issue" data-number="98"></p>
<p>
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:
</p>
<ol>
<li>Let |hometab:toplevel traversable| be the [=top-level
traversable=] of the [=home tab context=] associated with the
current window.
</li>
<li>Instead of [=navigating=] the top-level traversable,
[=navigate=] |hometab| with the same parameters.
</li>
<li>Focus |hometab|.
</li>
</ol>
<aside class="note">
Navigation from the home tab to a URL [=outside of home tab scope=]
will open a new regular tab, leaving the existing document open in
the home tab. Similarly, navigation from a regular tab to a URL
[=within home tab scope=] will open in the home tab, leaving the
existing document open in the tab that initiated the navigation.
Developers should ensure that in both of these cases, the document
left behind does not end up in an unexpected state.
</aside>
</section>
<section class="informative">
<h3>
Home tab invariants
</h3>
<p>
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=]:
</p>
<ul>
<li>every application window has exactly one [=home tab context=],
and
</li>
<li>every [=home tab context=]'s active document's [=Document/URL=]
is [=within home tab scope=] (unless the document's URL has changed
since it was created), and
</li>
<li>every non-home-tab [=application context=]'s active document's
[=Document/URL=] is [=outside of home tab scope=] (unless the
document's URL has changed since it was created).
</li>
</ul>
<p>
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.
</p>
<p>
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.
</p>
</section>
</section>
<section>
<h3>
<code><dfn>new_tab_button</dfn></code> member
</h3>
<p>
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:
</p>
<ul>
<li>[=new_tab_button/url=]
</li>
</ul>
<p>
The <code><dfn data-dfn-for="new_tab_button">url</dfn></code> member
is a string that represents a URL relative to the [=manifest URL=]
that is [=manifest/within scope=] of a [=Document/processed
manifest=].
</p>
<p>
An application <dfn>has a new tab button</dfn> 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.
</p>
<aside class="note">
<p>
The new tab button will be unavailable if its URL is [=within home
tab scope=]. This rule is necessary, since otherwise, it would
either imply that a) the new tab button would open a non-home tab
[=within home tab scope=], violating the third home tab invariant
above, or b) the new tab button would simply focus the home tab,
which would be redundant and confusing UI.
</p>
<p>
The default value for [=new_tab_button/url=] is the [=start URL=].
This means the button will be unavailable by default if the
application [=has a home tab=].
</p>
</aside>
<p>
When the new tab button is activated by the end user, the following
steps are run:
</p>
<ol>
<li>[=Create a new application context=] in the current window and
focus it.
</li>
<li>Navigate it to the value of the [=new_tab_button/url=] member of
[=new_tab_button=].
</li>
</ol>
</section>
<section>
<h2>
Processing the `tab_strip` member
</h2>
<p>
To <dfn>process the `tab_strip` member</dfn>, given [=ordered map=]
|json:ordered map|, [=ordered map=] |manifest:ordered map|, and
[=URL=] |manifest URL:URL|, run the following during the
<a data-cite="appmanifest#dfn-processing-extension-point-of-web-manifest">
extension point</a> in [=processing a manifest=]:
</p>
<ol>
<li>Set |manifest|["tab_strip"] to a new [=ordered map=].
</li>
<li>If |json|["tab_strip"] does not exist or |json|["tab_strip"] is
not an [=ordered map=]:
<ol>
<li>Set |manifest|["tab_strip"]["new_tab_button"]["url"] to
|manifest|["start_url"].
</li>
<li>Return.
</li>
</ol>
</li>
<li>[=Process the `home_tab` member=] passing |json|["tab_strip"],
|manifest|["tab_strip"], and |manifest URL|.
</li>
<li>[=Process the `new_tab_button` member=] passing
|json|["tab_strip"], |manifest|["tab_strip"], |manifest URL|, and
|manifest|["start_url"].
</li>
</ol>
<section>
<h3>
Processing the `home_tab` member
</h3>
<p>
To <dfn>process the `home_tab` member</dfn>, given [=ordered map=]
|json tab strip:ordered map|, [=ordered map=] |manifest tab
strip:ordered map|, and [=URL=] |manifest URL:URL|, run the
following:
</p>
<ol>
<li>If |json tab strip|["home_tab"] does not exist or |json tab
strip|["home_tab"] not an [=ordered map=], return.
</li>
<li>Let |home tab:ordered map| be a new [=ordered map=].
</li>
<li>[=Process the `scope_patterns` member=] passing |json tab
strip|["home_tab"]["scope_patterns"], |home tab| and |manifest
URL|.
</li>
<li>Set |manifest tab strip|["home_tab"] to |home tab|.
</li>
</ol>
</section>
<section>
<h3>
Processing the `new_tab_button` member
</h3>
<p>
To <dfn>process the `new_tab_button` member</dfn>, 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:
</p>
<ol>
<li>Set |manifest tab strip|["new_tab_button"]["url"] to |start
URL|.
</li>
<li>If |json tab strip|["new_tab_button"] does not exist or |json
tab strip|["new_tab_button"] is not an [=ordered map=], return.
</li>
<li>Let |url:URL| be the result of [=URL Parser|parsing=] |json tab
strip|["new_tab_button"]["url"] with |manifest URL| as the base
URL.
</li>
<li>If |url| is failure, return.
</li>
<li>If |url| is not [=URL/within scope=] of |manifest URL|, return.
</li>
<li>Set |manifest tab strip|["new_tab_button"]["url"] to |url|.
</li>
</ol>
</section>
<section>
<h3>
Processing the `scope_patterns` member
</h3>
<p>
To <dfn>process the `scope_patterns` member</dfn>, given [=ordered
map=] |json home tab:ordered map|, [=ordered map=] |manifest home
tab:ordered map| and [=URL=] |manifest URL:URL|, run the following:
</p>
<ol>
<li>Let |processed scope patterns:list| be a new [=list=].
</li>
<li>Set |manifest home tab|["scope_patterns"] to |processed scope
patterns|.
</li>
<li>If |json home tab|["scope_patterns"] doesn't exist or |json
home tab|["scope_patterns"] is not a [=list=], return.
</li>
<li>For each |entry:URLPatternInit| of |json home
tab|["scope_patterns"]:
<ol>
<li>Let |pattern:URL pattern| be the result of [=build a URL
pattern from an infra value|building a URL pattern from an
infra value=] |entry| given |manifest URL|. If this process
throws or returns null, continue.
</li>
<li>Append |pattern| to |processed scope patterns|.
</li>
</ol>
</li>
</ol>
<p class="issue" data-number="97"></p>
</section>
</section>
<section class="informative">
<h2>
Usage Example
</h2>
<pre class="example json" title="Tabbed application manifest">
{
"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"
}
}
}
</pre>
<p>
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 <code>/</code> or
<code>/index.html</code>) is opened in the [=home tab context=]. The
new tab button will open a new tab at <code>/create</code>.
</p>
<p>
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 <code>/index.html?utm_source=foo</code> 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.
</p>
</section>
</section>
<section>
<h2>
`share_target` member
</h2>
<p>
The `share_target` member registers a web application as "target" for
share actions (e.g., for sharing a text, a URL, or a file). The
`share_target` member is part of the [[[web-share-target]]]
specification.
</p>
</section>
<section>
<h2>
<code><dfn>note_taking</dfn></code> member
</h2>
<p>
The `note_taking` member of the <a data-cite=
"appmanifest#web-application-manifest">Web Application Manifest</a> is
an <a data-cite="appmanifest#dfn-object">object</a> that contains
information related to note-taking. It has the following members:
</p>
<ul>
<li>[=note_taking/new_note_url=]
</li>
</ul>
<p>
A user agent MAY use these members to treat the web application
differently as an application with note-taking capabilities (e.g.,
integrate with operating system note-taking surfaces).
</p>
<section>
<h3>
<code><dfn data-dfn-for="note_taking">new_note_url</dfn></code>
member
</h3>
<p>
The [=note_taking=] `new_note_url` member is a [=string=] that
represents the <a data-cite="url#concept-url">URL</a> the developer
would prefer the user agent load when the user wants to take a new
note using the web application (e.g., from an operating system
shortcut icon or keyboard shortcut).
</p>
<p>
The `new_note_url` member is purely advisory, and a user agent MAY
<a data-cite="appmanifest#dfn-ignore">ignore</a> it or provide the
end-user the choice of whether to use it. The user agent MAY provide
the end-user the choice to modify it.
</p>
<aside class="note">
<p>
The `new_note_url` member is parsed with <a data-cite=
"appmanifest#dfn-manifest-url">manifest URL</a> as the base URL and
is ignored if not [=manifest/within scope=] of the manifest.
</p>
</aside>
</section>
<section class="informative">
<h3>
Usage Example
</h3>
<p>
The following shows a [=manifest=] for a note-taking application.
</p>
<pre class="example json" title="Note-taking application">
{
"name": "My Note Taking App",
"description": "You can take notes!",
"icons": [{
"src": "icon/hd_hi",
"sizes": "128x128"
}],
"start_url": "/index.html",
"display": "standalone",
"note_taking": {
"new_note_url": "/new_note.html"
}
}
</pre>
</section>
<section>
<h3>
Processing the `note_taking` member
</h3>
<p>
To <dfn>process the `note_taking` member</dfn>, given [=ordered map=]
|json:ordered map|, [=ordered map=] |manifest:ordered map|, [=URL=]
|manifest_URL:URL|, run the following during the <a data-cite=
"appmanifest#dfn-processing-extension-point-of-web-manifest">extension
point</a> in [=processing a manifest=]:
</p>
<ol class="algorithm">
<li>If |json|["note_taking"] does not [=map/exist=], return.
</li>
<li>If the type of |json|["note_taking"] is not [=ordered map=],
return.
</li>
<li>Set |manifest|["note_taking"] to a new [=ordered map=].
</li>
<li>[=process the `new_note_url` member=] passing
|json|["note_taking"], |manifest|["note_taking"], and |manifest URL|.
</li>
</ol>
</section>
<section>
<h3>
Processing the `new_note_url` member
</h3>
<p>
To <dfn>process the `new_note_url` member</dfn>, given [=ordered
map=] |json_note_taking:ordered map|, [=ordered map=]
|manifest_note_taking:ordered map|, [=URL=] |manifest_URL:URL|, run
the following:
</p>
<ol class="algorithm">
<li>If |json_note_taking|["new_note_url"] does not [=map/exist=],
return.
</li>
<li>If the type of |json_note_taking|["new_note_url"] is not
[=string=], return.
</li>
<li>Let |new_note_url:URL| be the result of [=URL Parser|parsing=]
|json_note_taking|["new_note_url"] with |manifest URL| as the base
URL.
</li>
<li>If |new_note_url| is failure, return.
</li>
<li>If |new_note_url| is not [=manifest/within scope=] of |manifest
URL|, return.
</li>
<li>Set manifest_note_taking["new_note_url"] to |new_note_url|.
</li>
</ol>
</section>
<section>
<h3>
Launching the `new_note_url`
</h3>
<p>
To <dfn>launch the `new_note_url`</dfn>, given <a data-cite=
"appmanifest#dfn-processed-manifest">processed manifest</a>
|manifest:processed manifest|, run the following steps:
</p>
<ol>
<li>If |manifest|["note_taking"] does not [=map/exist=], return.
</li>
<li>If |manifest|["note_taking"]["new_note_url"] does not
[=map/exist=], return.
</li>
<li>If the type of |manifest|["note_taking"]["new_note_url"] is not
[=URL=], return.
</li>
<li>Run the steps to [=launch a web application=] setting |manifest|
to |manifest| and |target URL| to
|manifest|["note_taking"]["new_note_url"].
</li>
</ol>
<p>
The user agent MAY [=launch the `new_note_url`=] for a given
[=installed web application=] at any time, typically in response to a
user affordance.
</p>
</section>
</section>
<section>
<h2>
`protocol_handlers` member
</h2>
<p>
The [=manifest's=] <code><dfn data-dfn-for=
"manifest">protocol_handlers</dfn></code> member is an array of
<a>protocol handler description</a>s that allows a web application to
handle URL protocols.
</p>
<p>
On installation, a user agent SHOULD register protocol handlers with
the Operating System via interactions that are consistent with:
</p>
<ul>
<li>If there are multiple registered handlers for a protocol, the OS
allows the user to select which app should open it, and also allows the
user to set a default app.
</li>
<li>Clicking on a registered protocol will launch the registered
application. If this is the web app, then execute the [=invoke a
protocol handler=] steps defined in [=HTML=], where the user agent
SHOULD navigate to [=url=] and the appropriate browsing context is set
to a new top level browsing context.
</li>
</ul>
<aside class="note">
Protocol handlers could, for instance, be used for web app
communication where one app directly invokes another and passes data
via custom protocol links.
</aside>
<section>
<h3>
Processing the `protocol_handlers` member
</h3>
<p>
To <dfn>process the `protocol_handlers` member</dfn>, given
[=object=] |json:JSON|, |manifest:ordered map|:
</p>
<ol>
<li>Let |processedProtocolHandlers| be a new [=list=] of
|json:JSON|["|protocol_handlers|"].
</li>
<li>Set manifest["|protocol_handlers|"] to
|processedProtocolHandlers|.
</li>
<li>[=list/For each=] |protocol_handler| (<a>protocol handler
description</a>):
<ol>
<li>If |protocol_handler|["protocol"] or
|protocol_handler|["url"] is undefined, [=iteration/continue=].
</li>
<li>Let (|normalizedProtocol:string|, |normalizedUrl:URL|) be the
result of running [=normalize protocol handler parameters=] with
|protocol_handler|["protocol"], | protocol_handler|["url"] using
|manifest URL| as the base URL, and [=this=]'s relevant
[=environment settings object=]. If the result is failure,
[=iteration/continue=].
</li>
<li>If |normalizedUrl| is not [=manifest/within scope=] of
|manifest|, [=iteration/continue=].
</li>
<li>If |processedProtocolHandlers| [=list/contains=] the
|normalizedUrl|, [=iteration/continue=].
</li>
<li>[=List/Append=] |protocol_handler| to
|processedProtocolHandlers|.
</li>
</ol>
</li>
<li>[=list/For each=] |processedProtocolHandlers|, the user agent
SHOULD [=register a protocol handler=].
</li>
</ol>
<p>
A user agent SHOULD ask users for permission before registering a
[=protocol handler description=] <var>protocol_handler</var>s as the
default handler for a protocol with the host operating system. A user
agent MAY truncate the list of [=protocol handler description=]
<var>protocol_handlers</var> presented in order to remain consistent
with the conventions or limitations of the host operating system.
</p>
<aside class="example">
<p>
In the following example, the developer has included two [=protocol
handler description=] <var>protocol_handler</var>s. Assuming the
the manifest's URL is
<samp>https://example.com/manifest.webmanifest</samp>:
</p>
<ul>
<li>The first protocol handler would register to handle "web+music"
URLs (e.g.: web+music://#1234). When activated, the user agent
would instantiate a new[=top-level browsing context=] and navigate
to
<samp>https://example.com/play?songId=web+music://%231234</samp>.
</li>
<li>The second protocol handler would be ignored, as the protocol
provided does not start with "web+" and is not part of the
[=safelisted schemes=].
</li>
</ul>
<pre class="json">
{
"protocol_handlers": [
{
"protocol": "web+music",
"url": "/play?songId=%s"
},
{
"protocol": "store",
"url": "/buy?songId=%s"
}
]
}
</pre>
</aside>
</section>
<section>
<h2>
Protocol handler items
</h2>
<p>
Each <dfn>protocol handler description</dfn> is an [=object=] that
represents a protocol that the web application wants to handle,
corresponding to the [=manifest/protocol_handlers=] member. It has
the following members:
</p>
<ul>
<li>[=protocol handler description/protocol=]
</li>
<li>[=protocol handler description/url=]
</li>
</ul>
<p>
A user agent SHOULD use these values to register the web application
as a handler with the operating system. When the user activates a
protocol handler URL, the user agent SHOULD run <a>handling a
protocol launch</a>.
</p>
<p class="note">
[[HTML]]'s {{NavigatorContentUtils/registerProtocolHandler()}} allows
web sites to register themselves as possible handlers for particular
protocols. What constitutes valid [=protocol handler
description/protocol=] and [=protocol handler description/url=]
values for <a>protocol handler description</a>s is defined in that
API. Also note that the [[HTML]] API uses <code>scheme</code> where
we use [=protocol handler description/protocol=] but the same
restrictions apply.
</p>
<section>
<h3>
`protocol` member
</h3>
<p>
The <code><dfn data-dfn-for=
"protocol handler description">protocol</dfn></code> member of a
<a>protocol handler description</a> is a <a>string</a> that
represents the protocol to be handled, such as `mailto` or
`web+auth`.