-
Notifications
You must be signed in to change notification settings - Fork 60
Add network.setCacheBehavior command #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
233c9db
b8494a6
29dd853
d6213b3
fb9e9ee
e35f5e7
3aa68c5
e39132f
d30d864
331e65f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1435,10 +1435,23 @@ To <dfn>cleanup the session</dfn> given |session|: | |
|
||
1. [=Close the WebSocket connections=] with |session|. | ||
|
||
1. If [=active sessions=] is [=list/empty=], [=cleanup remote end state=]. | ||
|
||
1. Perform any implementation-specific cleanup steps. | ||
|
||
</div> | ||
|
||
<div algorithm> | ||
To <dfn>cleanup remote end state</dfn>. | ||
|
||
1. [=map/Clear=] the [=before request sent map=]. | ||
|
||
1. Set the [=default cache bypass=] to false. | ||
|
||
1. [=set/Empty=] the [=navigable cache bypass set=]. | ||
|
||
</div> | ||
|
||
<div algorithm> | ||
To <dfn>update the event map</dfn>, given | ||
|session|, |requested event names|, |browsing contexts|, and |enabled|: | ||
|
@@ -2324,6 +2337,9 @@ BrowsingContextEvent = ( | |
A [=remote end=] has a <dfn>device pixel ratio overrides</dfn> which is a weak map | ||
between [=navigables=] and device pixel ratio overrides. It is initially empty. | ||
|
||
Note: this map is not cleared when the final session ends i.e. device pixel | ||
ratio overrides outlive any WebDriver session. | ||
|
||
### Types ### {#module-browsingcontext-types} | ||
|
||
#### The browsingContext.BrowsingContext Type #### {#type-browsingContext-Browsingcontext} | ||
|
@@ -4689,7 +4705,8 @@ NetworkCommand = ( | |
network.ContinueWithAuth // | ||
network.FailRequest // | ||
network.ProvideResponse // | ||
network.RemoveIntercept | ||
network.RemoveIntercept // | ||
network.SetCacheBypass // | ||
jgraham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
) | ||
|
||
</pre> | ||
|
@@ -4716,6 +4733,13 @@ A [=remote end=] has a <dfn>before request sent map</dfn> which is initially an | |
empty map. It's used to track the network events for which a | ||
<code>network.beforeRequestSent</code> event has already been sent. | ||
|
||
A [=remote end=] has a <dfn>default cache bypass</dfn> which is a boolean. It is | ||
initially false. | ||
|
||
A [=remote end=] has a <dfn>navigable cache bypass set</dfn> which is initially an | ||
empty weak set. It's used to track the [=/top-level traversables=] in which | ||
network caches are bypassed. | ||
|
||
### Network Intercepts ### {#network-intercepts} | ||
|
||
A <dfn>network intercept</dfn> is a mechanism to allow remote ends to intercept | ||
|
@@ -4972,7 +4996,6 @@ request in addition to the context. | |
<div algorithm> | ||
To <dfn>process a network event</dfn> given |session|, |event|, and |request|: | ||
|
||
|
||
1. Let |request data| be the result of [=get the request data=] with |request|. | ||
|
||
<!-- TODO: update this to "[=request/navigation id=] once the fetch parts land--> | ||
|
@@ -6554,6 +6577,98 @@ requests will be affected. | |
|
||
</div> | ||
|
||
#### The network.setCacheBypass Command #### {#command-network-setCacheBypass} | ||
|
||
The <dfn export for=commands>network.setCacheBypass</dfn> command bypasses the | ||
network cache for certain requests. | ||
|
||
<dl> | ||
<dt>Command Type</dt> | ||
<dd> | ||
<pre class="cddl remote-cddl"> | ||
network.SetCacheBypass = ( | ||
method: "network.setCacheBypass", | ||
params: network.SetCacheBypassParameters | ||
) | ||
|
||
network.SetCacheBypassParameters = { | ||
bypass: bool, | ||
jgraham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
? contexts: [+browsingContext.BrowsingContext] | ||
} | ||
</pre> | ||
</dd> | ||
<dt>Return Type</dt> | ||
<dd> | ||
<pre class="cddl"> | ||
EmptyResult | ||
</pre> | ||
</dd> | ||
</dl> | ||
|
||
<div algorithm> | ||
The <dfn export>WebDriver BiDi bypass cache</dfn> steps given |request| are: | ||
jgraham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
1. Let |context| be null. | ||
|
||
1. If |request|'s [=request/window=] is an [=environment settings object=]: | ||
|
||
1. Let |environment settings| be |request|'s [=request/window=] | ||
|
||
1. If there is a [=/browsing context=] whose [=active window=] is |environment | ||
settings|' [=environment settings object/global object=], set |context| to | ||
the [=top-level browsing context=] for that browsing context. | ||
|
||
1. If |context| is not null and [=navigable cache bypass set=] [=set/contains=] | ||
|context|, return true. | ||
|
||
1. Return [=default cache bypass=]. | ||
|
||
</div> | ||
|
||
<div algorithm="remote end steps for network.setCacheBypass"> | ||
The [=remote end steps=] given <var ignore>session</var> and |command parameters| are: | ||
|
||
1. Let |bypass| be |command parameters|["<code>bypass</code>"]. | ||
|
||
1. If |command parameters| does not [=map/contain=] "<code>contexts</code>": | ||
|
||
1. Set the [=default cache bypass=] to |bypass|. | ||
jgraham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
1. If |bypass| is true, perform implementation-defined steps to disable any | ||
implementation-specific resource caches for network requests. Otherwise | ||
re-enable any implementation-specific resource caches for all contexts. | ||
jgraham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
1. Return [=success=] with data null. | ||
|
||
1. Let |contexts| be an empty [=/set=]. | ||
|
||
1. For each |context id| of |command parameters|["<code>contexts</code>"]: | ||
|
||
1. Let |context| be the result of [=trying=] to [=get a browsing context=] | ||
with |context id|. | ||
|
||
1. If |context| is not a [=top-level browsing context=], return [=error=] | ||
with [=error code=] [=invalid argument=]. | ||
|
||
1. [=list/Append=] |context| to |contexts|. | ||
|
||
1. For each |context| in |contexts|: | ||
whimboo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. If |bypass| is true: | ||
|
||
1. [=set/append=] |context| to [=navigable cache bypass set=]. | ||
|
||
1. Perform implementation-defined steps to disable any implementation-specific | ||
resource caches for network requests originating from |context|. | ||
|
||
1. Otherwise, if [=navigable cache bypass set=] [=set/contains=] | ||
|context|, [=set/remove=] |context| from [=navigable cache bypass set=] and | ||
re-enable any implementation-specific resource caches for network requests | ||
originating from |context|. | ||
|
||
|
||
1. Return [=success=] with data null. | ||
|
||
</div> | ||
|
||
### Events ### {#module-network-event} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.