@@ -93,6 +93,8 @@ spec: WEBDRIVER; urlPrefix: https://w3c.github.io/webdriver/
93
93
text: no such alert; url: dfn-no-such-alert
94
94
text: no such element; url: dfn-no-such-element
95
95
text: no such frame; url: dfn-no-such-frame
96
+ text: no such response; url: dfn-no-such-response
97
+ text: no response body; url: dfn-no-response-body
96
98
text: parse a page range; url: dfn-parse-a-page-range
97
99
text: handler; for: prompt handler configuration; url: dfn-handler
98
100
text: process capabilities; url: dfn-capabilities-processing
@@ -659,6 +661,7 @@ ErrorCode = "invalid argument" /
659
661
"invalid session id" /
660
662
"invalid web extension" /
661
663
"move target out of bounds" /
664
+ "no response body" /
662
665
"no such alert" /
663
666
"no such element" /
664
667
"no such frame" /
@@ -667,6 +670,7 @@ ErrorCode = "invalid argument" /
667
670
"no such intercept" /
668
671
"no such node" /
669
672
"no such request" /
673
+ "no such response" /
670
674
"no such script" /
671
675
"no such storage partition" /
672
676
"no such user context" /
@@ -5283,6 +5287,7 @@ NetworkCommand = (
5283
5287
network.ContinueResponse //
5284
5288
network.ContinueWithAuth //
5285
5289
network.FailRequest //
5290
+ network.GetResponseBody //
5286
5291
network.ProvideResponse //
5287
5292
network.RemoveIntercept //
5288
5293
network.SetCacheBehavior
@@ -5312,6 +5317,9 @@ A [=remote end=] has a <dfn>before request sent map</dfn> which is initially an
5312
5317
empty map. It's used to track the network events for which a
5313
5318
<code> network.beforeRequestSent</code> event has already been sent.
5314
5319
5320
+ A [=remote end=] has a <dfn>response map</dfn> that maps a [=request id=]
5321
+ to [=/response=] . Implementations may remove data from [=response map=] map at any time.
5322
+
5315
5323
A [=remote end=] has a <dfn>default cache behavior</dfn> which is a string. It is
5316
5324
initially "<code> default</code> ".
5317
5325
@@ -7056,6 +7064,59 @@ The [=remote end steps=] given |session| and |command parameters| are:
7056
7064
7057
7065
</div>
7058
7066
7067
+ #### The network.getResponseBody Command #### {#command-network-getResponseBody}
7068
+
7069
+ The <dfn export for=commands>network.getResponseBody</dfn> command retrieved the
7070
+ response body data if it is available.
7071
+
7072
+ <dl>
7073
+ <dt> Command Type</dt>
7074
+ <dd>
7075
+ <pre class="cddl remote-cddl">
7076
+ network.GetResponseBody = (
7077
+ method: "network.getResponseBody",
7078
+ params: network.GetResponseBodyParameters
7079
+ )
7080
+
7081
+ network.GetResponseBodyParameters = {
7082
+ request: network.Request,
7083
+ }
7084
+ </pre>
7085
+ </dd>
7086
+ <dt> Return Type</dt>
7087
+ <dd>
7088
+ <pre class="cddl local-cddl">
7089
+ script.GetResponseBodyResult = {
7090
+ body: network.BytesValue,
7091
+ }
7092
+ </pre>
7093
+ </dd>
7094
+ </dl>
7095
+
7096
+ <div algorithm="remote end steps for network.getResponseBody">
7097
+ The [=remote end steps=] given <var ignore> session</var> and |command parameters| are:
7098
+
7099
+ 1. Let |request id| be |command parameters|["<code>request</code>"] .
7100
+
7101
+ 1. If [=response map=] does not [=map/contain=] |request id|:
7102
+
7103
+ 1. Return [=error=] with [=error code=] [=no such response=] .
7104
+
7105
+ 1. Let |response| be [=response map=] [|request id|] .
7106
+
7107
+ 1. If |response|'s [=response/body=] is null,
7108
+
7109
+ 1. Return [=error=] with [=error code=] [=no response body=] .
7110
+
7111
+ 1. Let |body| be a [=/map=] matching the <code> script.GetResponseBodyResult</code> production,
7112
+ with the <code> body</code> field set to base-64 encoded value of |response|'s [=response/body=] .
7113
+ TODO: specify exact steps how to read the body.
7114
+
7115
+ 1. Return [=success=] with data |body|.
7116
+
7117
+ </div>
7118
+
7119
+
7059
7120
#### The network.provideResponse Command #### {#command-network-provideResponse}
7060
7121
7061
7122
The <dfn export for=commands>network.provideResponse</dfn> command continues a
@@ -7553,6 +7614,9 @@ completed</dfn> steps given |request| and |response|:
7553
7614
[=request/client=] . Otherwise let |related navigables| be an empty
7554
7615
set.
7555
7616
7617
+ 1. If the implementation is configured to save response data for |request|,
7618
+ set [=response map=] [|request|'s [=request id=] ] to |response|.
7619
+
7556
7620
1. For each |session| in the [=set of sessions for which an event is enabled=]
7557
7621
given "<code> network.responseCompleted</code> " and |related navigables|:
7558
7622
0 commit comments