@@ -2713,7 +2713,8 @@ The <dfn export for=commands>browser.createUserContext</dfn> command creates a
2713
2713
2714
2714
browser.CreateUserContextParameters = {
2715
2715
? acceptInsecureCerts: bool,
2716
- ? proxy: session.ProxyConfiguration
2716
+ ? proxy: session.ProxyConfiguration,
2717
+ ? unhandledPromptBehavior: session.UserPromptHandler
2717
2718
}
2718
2719
</pre>
2719
2720
</dd>
@@ -2747,6 +2748,10 @@ The [=remote end steps=] with |session| and |command parameters| are:
2747
2748
[=user context to accept insecure certificates override map=] [|user context|]
2748
2749
to |acceptInsecureCerts|.
2749
2750
2751
+ 1. If |command parameters| [=map/contains=] "<code> unhandledPromptBehavior</code> ",
2752
+ [=map/set=] [=unhandled prompt behavior overrides map=] [|user context|] to
2753
+ |command parameters|["<code>unhandledPromptBehavior</code>"] .
2754
+
2750
2755
1. If |command parameters| [=map/contains=] "<code> proxy</code> ":
2751
2756
2752
2757
1. Let |proxy configuration| be |command parameters|["<code>proxy</code>"] .
@@ -3115,11 +3120,22 @@ A <dfn>viewport configuration</dfn> is a [=struct=] with an [=struct/item=] name
3115
3120
<dfn attribute for="viewport-configuration">viewport</dfn> which is a [=viewport-configuration/viewport dimensions=]
3116
3121
or null and an [=struct/item=] named <dfn attribute for="viewport-configuration">devicePixelRatio</dfn> which is a float or null.
3117
3122
3123
+ An <dfn>unhandled prompt behavior struct</dfn> is a [=struct=] with:
3124
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-alert">alert</dfn> which is a string or null;
3125
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-beforeUnload">beforeUnload</dfn> which is a string or null;
3126
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-confirm">confirm</dfn> which is a string or null;
3127
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-default">default</dfn> which is a string or null;
3128
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-file">file</dfn> which is a string or null;
3129
+ * [=struct/Item=] named <dfn attribute for="unhandled-prompt-behavior-prompt">prompt</dfn> which is a string or null.
3130
+
3118
3131
A [=remote end=] has a <dfn>viewport overrides map</dfn> which is a weak map between [=user contexts=] and [=viewport configuration=] .
3119
3132
3120
3133
A [=remote end=] has a <dfn>locale overrides map</dfn> which is a weak map between
3121
3134
[=navigables=] or [=user contexts=] and string or null.
3122
3135
3136
+ A [=remote end=] has an <dfn>unhandled prompt behavior overrides map</dfn> which is a
3137
+ weak map between [=user contexts=] and [=unhandled prompt behavior struct=] .
3138
+
3123
3139
### Types ### {#module-browsingcontext-types}
3124
3140
3125
3141
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext}
@@ -5721,6 +5737,27 @@ closed</dfn> steps given |window|, |type|, |accepted| and optional |user text|
5721
5737
</dd>
5722
5738
</dl>
5723
5739
5740
+ <div algorithm>
5741
+ To <dfn>get navigable's user prompt handler</dfn> given |type| and |navigable|:
5742
+
5743
+ 1. Let |user context| be |navigable|'s [=associated user context=] .
5744
+
5745
+ 1. If [=unhandled prompt behavior overrides map=] [=map/contains=] |user context|:
5746
+
5747
+ 1. Let |unhandled prompt behavior override| be [=unhandled prompt behavior overrides map=] [|user context|] .
5748
+
5749
+ 1. If |unhandled prompt behavior override|[|type|] is not null, return
5750
+ |unhandled prompt behavior override|[|type|] .
5751
+
5752
+ 1. If |unhandled prompt behavior override|[<code>"default"</code>] is not null,
5753
+ return |unhandled prompt behavior override|[<code>"default"</code>] .
5754
+
5755
+ 1. Let |handler configuration| be [=get the prompt handler=] with |type|.
5756
+
5757
+ 1. Return |handler configuration|'s [=prompt handler configuration/handler=] .
5758
+
5759
+ </div>
5760
+
5724
5761
<div algorithm>
5725
5762
The [=remote end event trigger=] is the <dfn export>WebDriver BiDi user prompt
5726
5763
opened</dfn> steps given |window|, |type|, |message|, and optional |default value|
@@ -5730,10 +5767,8 @@ opened</dfn> steps given |window|, |type|, |message|, and optional |default valu
5730
5767
5731
5768
1. Let |navigable id| be the [=navigable id=] for |navigable|.
5732
5769
5733
- 1. Let |handler configuration| be [=get the prompt handler=] with |type|.
5734
-
5735
- 1. Let |handler| be |handler configuration|'s [=prompt handler
5736
- configuration/handler=] .
5770
+ 1. Let |handler| be [=get navigable's user prompt handler=] with |type| and
5771
+ |navigable|.
5737
5772
5738
5773
1. Let |params| be a [=/map=] matching the
5739
5774
<code> browsingContext.UserPromptOpenedParameters</code> production with the
0 commit comments