diff --git a/index.bs b/index.bs index 13fc7265..f6d246e3 100644 --- a/index.bs +++ b/index.bs @@ -4597,7 +4597,8 @@ NetworkCommand = ( network.ContinueWithAuth // network.FailRequest // network.ProvideResponse // - network.RemoveIntercept + network.RemoveIntercept // + network.SetCacheMode // ) @@ -4624,6 +4625,13 @@ A [=remote end=] has a before request sent map which is initially an empty map. It's used to track the network events for which a network.beforeRequestSent event has already been sent. +A [=remote end=] has a default cache mode override which is null or a +string. It is initially null. + +A [=remote end=] has a cache mode override map which is initially an +empty weak map. It's used to track the cache mode to use for requests from +specific browsing contexts. + ### Network Intercepts ### {#network-intercepts} A network intercept is a mechanism to allow remote ends to intercept @@ -4870,7 +4878,6 @@ request in addition to the context.
To process a network event given |session|, |event|, and |request|: - 1. Let |request data| be the result of [=get the request data=] with |request|. @@ -6438,6 +6445,90 @@ requests will be affected.
+#### The network.setCacheMode Command #### {#command-network-setCacheMode} + +The network.removeSetCacheMode command overrides +the network cache behaviour for certain requests. + +
+
Command Type
+
+
+      network.RemoveSetCacheMode = (
+        method: "network.setCacheMode",
+        params: network.SetCacheModeParameters
+      )
+
+      network.SetCacheModeParameters = {
+        mode: "no-store" / null,
+        ? contexts: [browsingContext.BrowsingContext]
+      }
+    
+
+
Return Type
+
+
+      EmptyResult
+    
+
+
+ +
+The WebDriver BiDi update request cache mode steps given +|request| are: + +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 context. + +1. If |context| is not null: + + 1. If [=cache mode override map=] [=map/contains=] |context|, set + |request|'s [=request/cache mode=] to [=cache mode override + map=][|context|] and return. + +1. If [=default cache mode override=] is not null, set + |request|'s [=request/cache mode=] to [=default cache mode override=]. + +
+ +
+The [=remote end steps=] given session and |command parameters| are: + +1. Let |mode| be |command parameters|["mode"]. + +1. If |command parameters| does not [=map/contain=] "contexts", set + the [=default cache mode override=] to |mode| and return [=success=] with + data null. + +1. Let |contexts| be an empty [=/list=]. + +1. For each |context id| of |command parameters|["contexts"]: + + 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|: + + 1. If |mode| is null and [=cache mode override map=] [=map/contains=] + |context| [=map/remove=] |context| from [=cache mode override map=]. + + 1. Otherwise, set [=cache mode override map=][|context|] to |mode|. + +1. Return [=success=] with data null. + +
### Events ### {#module-network-event}