Skip to content

Commit e40b28a

Browse files
Rewrite using generic WebDriver configuration
1 parent 89ea401 commit e40b28a

1 file changed

Lines changed: 10 additions & 44 deletions

File tree

index.bs

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,14 +3362,6 @@ weak map between [=user context|user contexts=] and [=unhandled prompt behavior
33623362
A [=remote end=] has a <dfn>scripting enabled overrides map</dfn> which is a weak
33633363
map between [=/navigables=] or [=user context|user contexts=] and boolean.
33643364

3365-
A [=remote end=] has a <dfn>bypass CSP configuration</dfn> which is a [=struct=] with
3366-
an [=struct/item=] named <dfn for="bypass CSP configuration">default bypass CSP configuration</dfn>,
3367-
which is initially null,
3368-
an [=struct/item=] named <dfn for="bypass CSP configuration">user context bypass CSP configuration</dfn>,
3369-
which is a weak map between [=user context|user contexts=] and boolean which is initially empty,
3370-
and an [=struct/item=] named <dfn for="bypass CSP configuration">navigable bypass CSP configuration</dfn>,
3371-
which is a weak map between [=/navigables=] and boolean which is initially empty.
3372-
33733365
### Types ### {#module-browsingcontext-types}
33743366

33753367
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext}
@@ -5060,62 +5052,36 @@ Note: When CSP bypass is enabled, all CSP directives are bypassed, including tho
50605052
</dd>
50615053
</dl>
50625054

5055+
A [=remote end=] has a <dfn>bypass CSP configuration</dfn>, which is
5056+
[=WebDriver configuration=] with [=WebDriver configuration/associated type=] boolean.
5057+
50635058
<div algorithm>
50645059

50655060
The <dfn export>WebDriver BiDi CSP is bypassed</dfn> steps given
50665061
[=/navigable=] |navigable| are:
50675062

50685063
1. Let |top-level traversable| be |navigable|'s [=navigable/top-level traversable=].
50695064

5070-
1. If [=bypass CSP configuration=]'s [=navigable bypass CSP configuration=] contains |top-level traversable|, return
5071-
[=bypass CSP configuration=]'s [=navigable bypass CSP configuration=][|top-level traversable|].
5072-
5073-
1. Let |user context| be |top-level traversable|'s [=associated user context=].
5065+
1. Let |bypass CSP enabled| be the result of [=get WebDriver configuration value=] of
5066+
[=bypass CSP configuration=] for |top-level traversable|.
50745067

5075-
1. If [=bypass CSP configuration=]'s [=user context bypass CSP configuration=] contains |user context|, return
5076-
[=bypass CSP configuration=]'s [=user context bypass CSP configuration=][|user context|].
5068+
1. Assert: |bypass CSP enabled| is <code>true</code> or [=WebDriver configuration/unset=].
50775069

5078-
1. If [=bypass CSP configuration=]'s [=default bypass CSP configuration=] is not null, return
5079-
[=bypass CSP configuration=]'s [=default bypass CSP configuration=].
5070+
1. If |bypass CSP enabled| is [=WebDriver configuration/unset=], return false.
50805071

5081-
1. Return false.
5072+
1. Return true.
50825073

50835074
</div>
50845075

50855076
<div algorithm="remote end steps for browsingContext.setBypassCSP">
50865077

50875078
The [=remote end steps=] given |command parameters| are:
50885079

5089-
1. If |command parameters| [=map/contains=] "<code>userContexts</code>"
5090-
and |command parameters| [=map/contains=] "<code>contexts</code>",
5091-
return [=error=] with [=error code=] [=invalid argument=].
5092-
50935080
1. Let |bypass| be |command parameters|["<code>bypass</code>"].
50945081

5095-
1. If |command parameters| [=map/contains=] "<code>contexts</code>":
5096-
5097-
1. Let |navigables| be the result of [=trying=] to
5098-
[=get valid top-level traversables by ids=] with
5099-
|command parameters|["<code>contexts</code>"].
5100-
5101-
1. For each |navigable| of |navigables|:
5102-
5103-
1. If |bypass| is null [=map/remove=] |navigable| from [=bypass CSP configuration=]'s [=navigable bypass CSP configuration=].
5104-
5105-
1. Otherwise [=map/set=] [=bypass CSP configuration=]'s [=navigable bypass CSP configuration=][|navigable|] to |bypass|.
5106-
5107-
1. Otherwise if |command parameters| [=map/contains=] "<code>userContexts</code>":
5108-
5109-
1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=]
5110-
with |command parameters|["<code>userContexts</code>"].
5111-
5112-
1. For each |user context| of |user contexts|:
5113-
5114-
1. If |bypass| is null [=map/remove=] |user context| from [=bypass CSP configuration=]'s [=user context bypass CSP configuration=].
5115-
5116-
1. Otherwise [=map/set=] [=bypass CSP configuration=]'s [=user context bypass CSP configuration=][|user context|] to |bypass|.
5082+
1. If |bypass| is null, set |bypass| to [=WebDriver configuration/unset=].
51175083

5118-
1. Otherwise set [=bypass CSP configuration=]'s [=default bypass CSP configuration=] to |bypass|.
5084+
1. [=Try=] to [=store WebDriver configuration=] [=bypass CSP configuration=] |bypass| for |command parameters|.
51195085

51205086
1. Return [=success=] with data null.
51215087

0 commit comments

Comments
 (0)