Skip to content

Commit 65b2af5

Browse files
authored
Gate beforeunload dialogs behind sticky activation
Closes #6139.
1 parent 3717f5d commit 65b2af5

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

source

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86177,20 +86177,28 @@ dictionary <dfn>PageTransitionEventInit</dfn> : <span>EventInit</span> {
8617786177
1.</p></li>
8617886178

8617986179
<li>
86180-
<p>If <var>document</var>'s <span>active sandboxing flag set</span> does not have its
86181-
<span>sandboxed modals flag</span> set, and the <code
86182-
data-x="dom-BeforeUnloadEvent-returnValue">returnValue</code> attribute of the <var>event</var>
86183-
object is not the empty string, or if the event was canceled, then the user agent may ask the
86184-
user to confirm that they wish to unload the document.</p>
86180+
<p>If all of the following are true:</p>
86181+
86182+
<ul class="brief">
86183+
<li><p><var>document</var>'s <span>active sandboxing flag set</span> does not have its
86184+
<span>sandboxed modals flag</span> set</p></li>
86185+
86186+
<li><p><var>document</var>'s <span>relevant global object</span> has <span>sticky
86187+
activation</span></p></li>
86188+
86189+
<li><p><var>event</var>'s <span>canceled flag</span> is set, or the <code
86190+
data-x="dom-BeforeUnloadEvent-returnValue">returnValue</code> attribute of <var>event</var> is
86191+
not the empty string</p></li>
86192+
</ul>
86193+
86194+
<p>then the user agent may ask the user to confirm that they wish to unload the document.</p>
8618586195

8618686196
<p class="note">The message shown to the user is not customizable, but instead determined by
8618786197
the user agent. In particular, the actual value of the <code
8618886198
data-x="dom-BeforeUnloadEvent-returnValue">returnValue</code> attribute is ignored.</p>
8618986199

8619086200
<p>The user agent is encouraged to avoid asking the user for confirmation if it judges that
86191-
doing so would be annoying, deceptive, or pointless. A simple heuristic might be that if the
86192-
user has not interacted with the document, the user agent would not ask for confirmation before
86193-
unloading it.</p>
86201+
doing so would be annoying, deceptive, or pointless.</p>
8619486202

8619586203
<p>If the user agent asks the user for confirmation, it must <span>pause</span> while waiting
8619686204
for the user's response.</p>

0 commit comments

Comments
 (0)