@@ -60,6 +60,9 @@ or "<code>rtl</code>").
60
60
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=body>body</dfn> (a
61
61
string).
62
62
63
+ <p> A <a for=/>notification</a> has an associated <dfn export for=notification>navigation URL</dfn>
64
+ (null or a <a for=/>URL</a> ). It is initially null.
65
+
63
66
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=tag>tag</dfn> (a string).
64
67
65
68
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=data>data</dfn> (a
@@ -137,6 +140,9 @@ support these features might ignore them.
137
140
<dt> <dfn for="notification action" id=action-title>title</dfn>
138
141
<dd> A string.
139
142
143
+ <dt> <dfn export for="notification action">navigation URL</dfn>
144
+ <dd> Null or a <a for=/>URL</a> . It is initially null.
145
+
140
146
<dt> <dfn for="notification action" id=action-icon-url>icon URL</dfn>
141
147
<dd> Null or a <a for=/>URL</a> . It is initially null.
142
148
@@ -220,6 +226,11 @@ important information through, e.g., loss of color or clipped corners.
220
226
<li><p> Set <var> notification</var> 's <a for=notification>body</a> to
221
227
<var> options</var> ["{{NotificationOptions/body}}"] .
222
228
229
+ <li><p> If <var> options</var> ["{{NotificationOptions/navigate}}"] <a for=map>exists</a> , then
230
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure, set
231
+ <var> notification</var> 's <a for=notification>navigation URL</a> to the return value. (Otherwise
232
+ <var> notification</var> 's <a for=notification>navigation URL</a> remains null.)
233
+
223
234
<li><p> Set <var> notification</var> 's <a for=notification>tag</a> to
224
235
<var> options</var> ["{{NotificationOptions/tag}}"] .
225
236
@@ -270,6 +281,11 @@ important information through, e.g., loss of color or clipped corners.
270
281
<li><p> Set <var> action</var> 's <a for="notification action">title</a> to
271
282
<var> entry</var> ["{{NotificationAction/title}}"] .
272
283
284
+ <li><p> If <var> entry</var> ["{{NotificationAction/navigate}}"] <a for=map>exists</a> , then
285
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
286
+ set <var> action</var> 's <a for="notification action">navigation URL</a> to the return value.
287
+ (Otherwise <var> action</var> 's <a for="notification action">navigation URL</a> remains null.)
288
+
273
289
<li><p> If <var> entry</var> ["{{NotificationAction/icon}}"] <a for=map>exists</a> , then
274
290
<a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
275
291
set <var> action</var> 's <a for="notification action">icon URL</a> to the return value. (Otherwise
@@ -541,18 +557,53 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
541
557
platform supports activation, the user agent must (unless otherwise specified) run these steps:
542
558
543
559
<ol>
560
+ <li><p> Let <var> action</var> be null.
561
+
562
+ <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the end
563
+ user, then set <var> action</var> to that <a for=/>notification action</a> .
564
+
565
+ <li><p> Let <var> navigationURL</var> be <var> notification</var> 's
566
+ <a for=notification>navigation URL</a> .
567
+
568
+ <li>
569
+ <p> If <var> action</var> is non-null, then set <var> navigationURL</var> to <var> action</var> 's
570
+ <a for="notification action">navigation URL</a> .
571
+
572
+ <p class=note> This intentionally makes it so that when a <a for=/>notification action</a> 's
573
+ <a for="notification action">navigation URL</a> is null, it falls through to the
574
+ <code> click</code> event, providing more flexibility to the web developer.
575
+
576
+ <li>
577
+ <p> If <var> navigationURL</var> is non-null:
578
+
579
+ <ol>
580
+ <li>
581
+ <p> Select one of the following two options in an <a>implementation-defined</a> manner:
582
+
583
+ <ul>
584
+ <li><p> <a for=/>Navigate</a> an existing <a for=/>top-level traversable</a> within the user
585
+ agent's <a for="user agent">top-level traversable set</a> to <var> navigationURL</var> .
586
+ <!-- Should maybe set userInvolvement to "browser UI" here and below. -->
587
+
588
+ <li><p> <a>Create a fresh top-level traversable</a> given <var> navigationURL</var> .
589
+ </ul>
590
+
591
+ <p class=note> User agents are strongly encouraged to match platform conventions.
592
+
593
+ <li><p> Return.
594
+ </ol>
595
+
544
596
<li>
545
597
<p> If <var> notification</var> is a <a>persistent notification</a> , then:
546
598
547
599
<ol>
548
- <li><p> Let <var> action </var> be the empty string.
600
+ <li><p> Let <var> actionName </var> be the empty string.
549
601
550
- <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the
551
- user, then set <var> action</var> to that <a for=/>notification action</a> 's
602
+ <li><p> If <var> action</var> is non-null, then set <var> actionName</var> to <var> action</var> 's
552
603
<a for="notification action">name</a> .
553
604
554
605
<li> <a>Fire a service worker notification event</a> named "<code> notificationclick</code> " given
555
- <var> notification</var> and <var> action </var> .
606
+ <var> notification</var> and <var> actionName </var> .
556
607
</ol>
557
608
558
609
<li>
@@ -643,6 +694,7 @@ interface Notification : EventTarget {
643
694
readonly attribute NotificationDirection dir;
644
695
readonly attribute DOMString lang;
645
696
readonly attribute DOMString body;
697
+ readonly attribute USVString navigate;
646
698
readonly attribute DOMString tag;
647
699
readonly attribute USVString image;
648
700
readonly attribute USVString icon;
@@ -662,6 +714,7 @@ dictionary NotificationOptions {
662
714
NotificationDirection dir = "auto";
663
715
DOMString lang = "";
664
716
DOMString body = "";
717
+ USVString navigate;
665
718
DOMString tag = "";
666
719
USVString image;
667
720
USVString icon;
@@ -690,6 +743,7 @@ enum NotificationDirection {
690
743
dictionary NotificationAction {
691
744
required DOMString action;
692
745
required DOMString title;
746
+ USVString navigate;
693
747
USVString icon;
694
748
};
695
749
@@ -853,6 +907,16 @@ return the <a>maximum number of actions</a> supported.
853
907
<p> The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
854
908
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>body</a> .
855
909
910
+ <p> The <dfn attribute for=Notification><code>navigate</code></dfn> getter steps are:
911
+
912
+ <ol>
913
+ <li><p> If <a>this</a> 's <a>notification</a>' s <a for=notification>navigation URL</a> is null, then
914
+ return the empty string.
915
+
916
+ <li><p> Return <a>this</a> 's <a>notification</a>' s <a for=notification>navigation URL</a> ,
917
+ <a lt="URL serializer">serialized</a> .
918
+ </ol>
919
+
856
920
<p> The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
857
921
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>tag</a> .
858
922
@@ -925,6 +989,10 @@ then return null.
925
989
<li><p> Set <var> action</var> ["{{NotificationAction/title}}"] to <var> entry</var> 's
926
990
<a for="notification action">title</a> .
927
991
992
+ <li><p> If <var> entry</var> 's <a for="notification action">navigation URL</a> is non-null, then
993
+ set <var> action</var> ["{{NotificationAction/navigate}}"] to <var> entry</var> 's
994
+ <a for="notification action">navigation URL</a> , <a lt="URL serializer">serialized</a> .
995
+
928
996
<li><p> If <var> entry</var> 's <a for="notification action">icon URL</a> is non-null, then set
929
997
<var> action</var> ["{{NotificationAction/icon}}"] to <var> entry</var> 's
930
998
<a for="notification action">icon URL</a> , <a lt="URL serializer">serialized</a> .
@@ -1211,6 +1279,7 @@ Alex Russell,
1211
1279
Anssi Kostiainen,
1212
1280
Arkadiusz Michalski,
1213
1281
Boris Zbarsky,
1282
+ Brady Eidson,
1214
1283
David Håsäther,
1215
1284
Doug Turner,
1216
1285
Drew Wilson,
@@ -1222,6 +1291,7 @@ James Graham,
1222
1291
John Mellor,
1223
1292
Jon Lee,
1224
1293
Jonas Sicking,
1294
+ Kagami Sascha Rosylight<!-- saschanaz; GitHub -->,
1225
1295
Michael Cooper,
1226
1296
Michael Henretty,
1227
1297
Michael™ Smith,
0 commit comments