network.go 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. // Package network provides the Chrome DevTools Protocol
  2. // commands, types, and events for the Network domain.
  3. //
  4. // Network domain allows tracking network activities of the page. It exposes
  5. // information about http, file, data and other requests and responses, their
  6. // headers, bodies, timing, etc.
  7. //
  8. // Generated by the cdproto-gen command.
  9. package network
  10. // Code generated by cdproto-gen. DO NOT EDIT.
  11. import (
  12. "context"
  13. "encoding/base64"
  14. "github.com/chromedp/cdproto/cdp"
  15. "github.com/chromedp/cdproto/debugger"
  16. "github.com/chromedp/cdproto/io"
  17. )
  18. // SetAcceptedEncodingsParams sets a list of content encodings that will be
  19. // accepted. Empty list means no encoding is accepted.
  20. type SetAcceptedEncodingsParams struct {
  21. Encodings []ContentEncoding `json:"encodings"` // List of accepted content encodings.
  22. }
  23. // SetAcceptedEncodings sets a list of content encodings that will be
  24. // accepted. Empty list means no encoding is accepted.
  25. //
  26. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAcceptedEncodings
  27. //
  28. // parameters:
  29. //
  30. // encodings - List of accepted content encodings.
  31. func SetAcceptedEncodings(encodings []ContentEncoding) *SetAcceptedEncodingsParams {
  32. return &SetAcceptedEncodingsParams{
  33. Encodings: encodings,
  34. }
  35. }
  36. // Do executes Network.setAcceptedEncodings against the provided context.
  37. func (p *SetAcceptedEncodingsParams) Do(ctx context.Context) (err error) {
  38. return cdp.Execute(ctx, CommandSetAcceptedEncodings, p, nil)
  39. }
  40. // ClearAcceptedEncodingsOverrideParams clears accepted encodings set by
  41. // setAcceptedEncodings.
  42. type ClearAcceptedEncodingsOverrideParams struct{}
  43. // ClearAcceptedEncodingsOverride clears accepted encodings set by
  44. // setAcceptedEncodings.
  45. //
  46. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearAcceptedEncodingsOverride
  47. func ClearAcceptedEncodingsOverride() *ClearAcceptedEncodingsOverrideParams {
  48. return &ClearAcceptedEncodingsOverrideParams{}
  49. }
  50. // Do executes Network.clearAcceptedEncodingsOverride against the provided context.
  51. func (p *ClearAcceptedEncodingsOverrideParams) Do(ctx context.Context) (err error) {
  52. return cdp.Execute(ctx, CommandClearAcceptedEncodingsOverride, nil, nil)
  53. }
  54. // ClearBrowserCacheParams clears browser cache.
  55. type ClearBrowserCacheParams struct{}
  56. // ClearBrowserCache clears browser cache.
  57. //
  58. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearBrowserCache
  59. func ClearBrowserCache() *ClearBrowserCacheParams {
  60. return &ClearBrowserCacheParams{}
  61. }
  62. // Do executes Network.clearBrowserCache against the provided context.
  63. func (p *ClearBrowserCacheParams) Do(ctx context.Context) (err error) {
  64. return cdp.Execute(ctx, CommandClearBrowserCache, nil, nil)
  65. }
  66. // ClearBrowserCookiesParams clears browser cookies.
  67. type ClearBrowserCookiesParams struct{}
  68. // ClearBrowserCookies clears browser cookies.
  69. //
  70. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-clearBrowserCookies
  71. func ClearBrowserCookies() *ClearBrowserCookiesParams {
  72. return &ClearBrowserCookiesParams{}
  73. }
  74. // Do executes Network.clearBrowserCookies against the provided context.
  75. func (p *ClearBrowserCookiesParams) Do(ctx context.Context) (err error) {
  76. return cdp.Execute(ctx, CommandClearBrowserCookies, nil, nil)
  77. }
  78. // DeleteCookiesParams deletes browser cookies with matching name and url or
  79. // domain/path/partitionKey pair.
  80. type DeleteCookiesParams struct {
  81. Name string `json:"name"` // Name of the cookies to remove.
  82. URL string `json:"url,omitempty,omitzero"` // If specified, deletes all the cookies with the given name where domain and path match provided URL.
  83. Domain string `json:"domain,omitempty,omitzero"` // If specified, deletes only cookies with the exact domain.
  84. Path string `json:"path,omitempty,omitzero"` // If specified, deletes only cookies with the exact path.
  85. PartitionKey *CookiePartitionKey `json:"partitionKey,omitempty,omitzero"` // If specified, deletes only cookies with the the given name and partitionKey where all partition key attributes match the cookie partition key attribute.
  86. }
  87. // DeleteCookies deletes browser cookies with matching name and url or
  88. // domain/path/partitionKey pair.
  89. //
  90. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-deleteCookies
  91. //
  92. // parameters:
  93. //
  94. // name - Name of the cookies to remove.
  95. func DeleteCookies(name string) *DeleteCookiesParams {
  96. return &DeleteCookiesParams{
  97. Name: name,
  98. }
  99. }
  100. // WithURL if specified, deletes all the cookies with the given name where
  101. // domain and path match provided URL.
  102. func (p DeleteCookiesParams) WithURL(url string) *DeleteCookiesParams {
  103. p.URL = url
  104. return &p
  105. }
  106. // WithDomain if specified, deletes only cookies with the exact domain.
  107. func (p DeleteCookiesParams) WithDomain(domain string) *DeleteCookiesParams {
  108. p.Domain = domain
  109. return &p
  110. }
  111. // WithPath if specified, deletes only cookies with the exact path.
  112. func (p DeleteCookiesParams) WithPath(path string) *DeleteCookiesParams {
  113. p.Path = path
  114. return &p
  115. }
  116. // WithPartitionKey if specified, deletes only cookies with the the given
  117. // name and partitionKey where all partition key attributes match the cookie
  118. // partition key attribute.
  119. func (p DeleteCookiesParams) WithPartitionKey(partitionKey *CookiePartitionKey) *DeleteCookiesParams {
  120. p.PartitionKey = partitionKey
  121. return &p
  122. }
  123. // Do executes Network.deleteCookies against the provided context.
  124. func (p *DeleteCookiesParams) Do(ctx context.Context) (err error) {
  125. return cdp.Execute(ctx, CommandDeleteCookies, p, nil)
  126. }
  127. // DisableParams disables network tracking, prevents network events from
  128. // being sent to the client.
  129. type DisableParams struct{}
  130. // Disable disables network tracking, prevents network events from being sent
  131. // to the client.
  132. //
  133. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-disable
  134. func Disable() *DisableParams {
  135. return &DisableParams{}
  136. }
  137. // Do executes Network.disable against the provided context.
  138. func (p *DisableParams) Do(ctx context.Context) (err error) {
  139. return cdp.Execute(ctx, CommandDisable, nil, nil)
  140. }
  141. // EmulateNetworkConditionsParams activates emulation of network conditions.
  142. type EmulateNetworkConditionsParams struct {
  143. Offline bool `json:"offline"` // True to emulate internet disconnection.
  144. Latency float64 `json:"latency"` // Minimum latency from request sent to response headers received (ms).
  145. DownloadThroughput float64 `json:"downloadThroughput"` // Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
  146. UploadThroughput float64 `json:"uploadThroughput"` // Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
  147. ConnectionType ConnectionType `json:"connectionType,omitempty,omitzero"` // Connection type if known.
  148. PacketLoss float64 `json:"packetLoss,omitempty,omitzero"` // WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
  149. PacketQueueLength int64 `json:"packetQueueLength,omitempty,omitzero"` // WebRTC packet queue length (packet). 0 removes any queue length limitations.
  150. PacketReordering bool `json:"packetReordering"` // WebRTC packetReordering feature.
  151. }
  152. // EmulateNetworkConditions activates emulation of network conditions.
  153. //
  154. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-emulateNetworkConditions
  155. //
  156. // parameters:
  157. //
  158. // offline - True to emulate internet disconnection.
  159. // latency - Minimum latency from request sent to response headers received (ms).
  160. // downloadThroughput - Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
  161. // uploadThroughput - Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
  162. func EmulateNetworkConditions(offline bool, latency float64, downloadThroughput float64, uploadThroughput float64) *EmulateNetworkConditionsParams {
  163. return &EmulateNetworkConditionsParams{
  164. Offline: offline,
  165. Latency: latency,
  166. DownloadThroughput: downloadThroughput,
  167. UploadThroughput: uploadThroughput,
  168. PacketReordering: false,
  169. }
  170. }
  171. // WithConnectionType connection type if known.
  172. func (p EmulateNetworkConditionsParams) WithConnectionType(connectionType ConnectionType) *EmulateNetworkConditionsParams {
  173. p.ConnectionType = connectionType
  174. return &p
  175. }
  176. // WithPacketLoss webRTC packet loss (percent, 0-100). 0 disables packet loss
  177. // emulation, 100 drops all the packets.
  178. func (p EmulateNetworkConditionsParams) WithPacketLoss(packetLoss float64) *EmulateNetworkConditionsParams {
  179. p.PacketLoss = packetLoss
  180. return &p
  181. }
  182. // WithPacketQueueLength webRTC packet queue length (packet). 0 removes any
  183. // queue length limitations.
  184. func (p EmulateNetworkConditionsParams) WithPacketQueueLength(packetQueueLength int64) *EmulateNetworkConditionsParams {
  185. p.PacketQueueLength = packetQueueLength
  186. return &p
  187. }
  188. // WithPacketReordering webRTC packetReordering feature.
  189. func (p EmulateNetworkConditionsParams) WithPacketReordering(packetReordering bool) *EmulateNetworkConditionsParams {
  190. p.PacketReordering = packetReordering
  191. return &p
  192. }
  193. // Do executes Network.emulateNetworkConditions against the provided context.
  194. func (p *EmulateNetworkConditionsParams) Do(ctx context.Context) (err error) {
  195. return cdp.Execute(ctx, CommandEmulateNetworkConditions, p, nil)
  196. }
  197. // EnableParams enables network tracking, network events will now be
  198. // delivered to the client.
  199. type EnableParams struct {
  200. MaxTotalBufferSize int64 `json:"maxTotalBufferSize,omitempty,omitzero"` // Buffer size in bytes to use when preserving network payloads (XHRs, etc).
  201. MaxResourceBufferSize int64 `json:"maxResourceBufferSize,omitempty,omitzero"` // Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
  202. MaxPostDataSize int64 `json:"maxPostDataSize,omitempty,omitzero"` // Longest post body size (in bytes) that would be included in requestWillBeSent notification
  203. }
  204. // Enable enables network tracking, network events will now be delivered to
  205. // the client.
  206. //
  207. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-enable
  208. //
  209. // parameters:
  210. func Enable() *EnableParams {
  211. return &EnableParams{}
  212. }
  213. // WithMaxTotalBufferSize buffer size in bytes to use when preserving network
  214. // payloads (XHRs, etc).
  215. func (p EnableParams) WithMaxTotalBufferSize(maxTotalBufferSize int64) *EnableParams {
  216. p.MaxTotalBufferSize = maxTotalBufferSize
  217. return &p
  218. }
  219. // WithMaxResourceBufferSize per-resource buffer size in bytes to use when
  220. // preserving network payloads (XHRs, etc).
  221. func (p EnableParams) WithMaxResourceBufferSize(maxResourceBufferSize int64) *EnableParams {
  222. p.MaxResourceBufferSize = maxResourceBufferSize
  223. return &p
  224. }
  225. // WithMaxPostDataSize longest post body size (in bytes) that would be
  226. // included in requestWillBeSent notification.
  227. func (p EnableParams) WithMaxPostDataSize(maxPostDataSize int64) *EnableParams {
  228. p.MaxPostDataSize = maxPostDataSize
  229. return &p
  230. }
  231. // Do executes Network.enable against the provided context.
  232. func (p *EnableParams) Do(ctx context.Context) (err error) {
  233. return cdp.Execute(ctx, CommandEnable, p, nil)
  234. }
  235. // GetCertificateParams returns the DER-encoded certificate.
  236. type GetCertificateParams struct {
  237. Origin string `json:"origin"` // Origin to get certificate for.
  238. }
  239. // GetCertificate returns the DER-encoded certificate.
  240. //
  241. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getCertificate
  242. //
  243. // parameters:
  244. //
  245. // origin - Origin to get certificate for.
  246. func GetCertificate(origin string) *GetCertificateParams {
  247. return &GetCertificateParams{
  248. Origin: origin,
  249. }
  250. }
  251. // GetCertificateReturns return values.
  252. type GetCertificateReturns struct {
  253. TableNames []string `json:"tableNames,omitempty,omitzero"`
  254. }
  255. // Do executes Network.getCertificate against the provided context.
  256. //
  257. // returns:
  258. //
  259. // tableNames
  260. func (p *GetCertificateParams) Do(ctx context.Context) (tableNames []string, err error) {
  261. // execute
  262. var res GetCertificateReturns
  263. err = cdp.Execute(ctx, CommandGetCertificate, p, &res)
  264. if err != nil {
  265. return nil, err
  266. }
  267. return res.TableNames, nil
  268. }
  269. // GetCookiesParams returns all browser cookies for the current URL.
  270. // Depending on the backend support, will return detailed cookie information in
  271. // the cookies field.
  272. type GetCookiesParams struct {
  273. URLs []string `json:"urls,omitempty,omitzero"` // The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list containing the URLs of the page and all of its subframes.
  274. }
  275. // GetCookies returns all browser cookies for the current URL. Depending on
  276. // the backend support, will return detailed cookie information in the cookies
  277. // field.
  278. //
  279. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getCookies
  280. //
  281. // parameters:
  282. func GetCookies() *GetCookiesParams {
  283. return &GetCookiesParams{}
  284. }
  285. // WithURLs the list of URLs for which applicable cookies will be fetched. If
  286. // not specified, it's assumed to be set to the list containing the URLs of the
  287. // page and all of its subframes.
  288. func (p GetCookiesParams) WithURLs(urls []string) *GetCookiesParams {
  289. p.URLs = urls
  290. return &p
  291. }
  292. // GetCookiesReturns return values.
  293. type GetCookiesReturns struct {
  294. Cookies []*Cookie `json:"cookies,omitempty,omitzero"` // Array of cookie objects.
  295. }
  296. // Do executes Network.getCookies against the provided context.
  297. //
  298. // returns:
  299. //
  300. // cookies - Array of cookie objects.
  301. func (p *GetCookiesParams) Do(ctx context.Context) (cookies []*Cookie, err error) {
  302. // execute
  303. var res GetCookiesReturns
  304. err = cdp.Execute(ctx, CommandGetCookies, p, &res)
  305. if err != nil {
  306. return nil, err
  307. }
  308. return res.Cookies, nil
  309. }
  310. // GetResponseBodyParams returns content served for the given request.
  311. type GetResponseBodyParams struct {
  312. RequestID RequestID `json:"requestId"` // Identifier of the network request to get content for.
  313. }
  314. // GetResponseBody returns content served for the given request.
  315. //
  316. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getResponseBody
  317. //
  318. // parameters:
  319. //
  320. // requestID - Identifier of the network request to get content for.
  321. func GetResponseBody(requestID RequestID) *GetResponseBodyParams {
  322. return &GetResponseBodyParams{
  323. RequestID: requestID,
  324. }
  325. }
  326. // GetResponseBodyReturns return values.
  327. type GetResponseBodyReturns struct {
  328. Body string `json:"body,omitempty,omitzero"` // Response body.
  329. Base64encoded bool `json:"base64Encoded"` // True, if content was sent as base64.
  330. }
  331. // Do executes Network.getResponseBody against the provided context.
  332. //
  333. // returns:
  334. //
  335. // body - Response body.
  336. func (p *GetResponseBodyParams) Do(ctx context.Context) (body []byte, err error) {
  337. // execute
  338. var res GetResponseBodyReturns
  339. err = cdp.Execute(ctx, CommandGetResponseBody, p, &res)
  340. if err != nil {
  341. return nil, err
  342. }
  343. // decode
  344. var dec []byte
  345. if res.Base64encoded {
  346. dec, err = base64.StdEncoding.DecodeString(res.Body)
  347. if err != nil {
  348. return nil, err
  349. }
  350. } else {
  351. dec = []byte(res.Body)
  352. }
  353. return dec, nil
  354. }
  355. // GetRequestPostDataParams returns post data sent with the request. Returns
  356. // an error when no data was sent with the request.
  357. type GetRequestPostDataParams struct {
  358. RequestID RequestID `json:"requestId"` // Identifier of the network request to get content for.
  359. }
  360. // GetRequestPostData returns post data sent with the request. Returns an
  361. // error when no data was sent with the request.
  362. //
  363. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getRequestPostData
  364. //
  365. // parameters:
  366. //
  367. // requestID - Identifier of the network request to get content for.
  368. func GetRequestPostData(requestID RequestID) *GetRequestPostDataParams {
  369. return &GetRequestPostDataParams{
  370. RequestID: requestID,
  371. }
  372. }
  373. // GetRequestPostDataReturns return values.
  374. type GetRequestPostDataReturns struct {
  375. PostData string `json:"postData,omitempty,omitzero"` // Request body string, omitting files from multipart requests
  376. }
  377. // Do executes Network.getRequestPostData against the provided context.
  378. //
  379. // returns:
  380. //
  381. // postData - Request body string, omitting files from multipart requests
  382. func (p *GetRequestPostDataParams) Do(ctx context.Context) (postData string, err error) {
  383. // execute
  384. var res GetRequestPostDataReturns
  385. err = cdp.Execute(ctx, CommandGetRequestPostData, p, &res)
  386. if err != nil {
  387. return "", err
  388. }
  389. return res.PostData, nil
  390. }
  391. // GetResponseBodyForInterceptionParams returns content served for the given
  392. // currently intercepted request.
  393. type GetResponseBodyForInterceptionParams struct {
  394. InterceptionID InterceptionID `json:"interceptionId"` // Identifier for the intercepted request to get body for.
  395. }
  396. // GetResponseBodyForInterception returns content served for the given
  397. // currently intercepted request.
  398. //
  399. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getResponseBodyForInterception
  400. //
  401. // parameters:
  402. //
  403. // interceptionID - Identifier for the intercepted request to get body for.
  404. func GetResponseBodyForInterception(interceptionID InterceptionID) *GetResponseBodyForInterceptionParams {
  405. return &GetResponseBodyForInterceptionParams{
  406. InterceptionID: interceptionID,
  407. }
  408. }
  409. // GetResponseBodyForInterceptionReturns return values.
  410. type GetResponseBodyForInterceptionReturns struct {
  411. Body string `json:"body,omitempty,omitzero"` // Response body.
  412. Base64encoded bool `json:"base64Encoded"` // True, if content was sent as base64.
  413. }
  414. // Do executes Network.getResponseBodyForInterception against the provided context.
  415. //
  416. // returns:
  417. //
  418. // body - Response body.
  419. func (p *GetResponseBodyForInterceptionParams) Do(ctx context.Context) (body []byte, err error) {
  420. // execute
  421. var res GetResponseBodyForInterceptionReturns
  422. err = cdp.Execute(ctx, CommandGetResponseBodyForInterception, p, &res)
  423. if err != nil {
  424. return nil, err
  425. }
  426. // decode
  427. var dec []byte
  428. if res.Base64encoded {
  429. dec, err = base64.StdEncoding.DecodeString(res.Body)
  430. if err != nil {
  431. return nil, err
  432. }
  433. } else {
  434. dec = []byte(res.Body)
  435. }
  436. return dec, nil
  437. }
  438. // TakeResponseBodyForInterceptionAsStreamParams returns a handle to the
  439. // stream representing the response body. Note that after this command, the
  440. // intercepted request can't be continued as is -- you either need to cancel it
  441. // or to provide the response body. The stream only supports sequential read,
  442. // IO.read will fail if the position is specified.
  443. type TakeResponseBodyForInterceptionAsStreamParams struct {
  444. InterceptionID InterceptionID `json:"interceptionId"`
  445. }
  446. // TakeResponseBodyForInterceptionAsStream returns a handle to the stream
  447. // representing the response body. Note that after this command, the intercepted
  448. // request can't be continued as is -- you either need to cancel it or to
  449. // provide the response body. The stream only supports sequential read, IO.read
  450. // will fail if the position is specified.
  451. //
  452. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-takeResponseBodyForInterceptionAsStream
  453. //
  454. // parameters:
  455. //
  456. // interceptionID
  457. func TakeResponseBodyForInterceptionAsStream(interceptionID InterceptionID) *TakeResponseBodyForInterceptionAsStreamParams {
  458. return &TakeResponseBodyForInterceptionAsStreamParams{
  459. InterceptionID: interceptionID,
  460. }
  461. }
  462. // TakeResponseBodyForInterceptionAsStreamReturns return values.
  463. type TakeResponseBodyForInterceptionAsStreamReturns struct {
  464. Stream io.StreamHandle `json:"stream,omitempty,omitzero"`
  465. }
  466. // Do executes Network.takeResponseBodyForInterceptionAsStream against the provided context.
  467. //
  468. // returns:
  469. //
  470. // stream
  471. func (p *TakeResponseBodyForInterceptionAsStreamParams) Do(ctx context.Context) (stream io.StreamHandle, err error) {
  472. // execute
  473. var res TakeResponseBodyForInterceptionAsStreamReturns
  474. err = cdp.Execute(ctx, CommandTakeResponseBodyForInterceptionAsStream, p, &res)
  475. if err != nil {
  476. return "", err
  477. }
  478. return res.Stream, nil
  479. }
  480. // ReplayXHRParams this method sends a new XMLHttpRequest which is identical
  481. // to the original one. The following parameters should be identical: method,
  482. // url, async, request body, extra headers, withCredentials attribute, user,
  483. // password.
  484. type ReplayXHRParams struct {
  485. RequestID RequestID `json:"requestId"` // Identifier of XHR to replay.
  486. }
  487. // ReplayXHR this method sends a new XMLHttpRequest which is identical to the
  488. // original one. The following parameters should be identical: method, url,
  489. // async, request body, extra headers, withCredentials attribute, user,
  490. // password.
  491. //
  492. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-replayXHR
  493. //
  494. // parameters:
  495. //
  496. // requestID - Identifier of XHR to replay.
  497. func ReplayXHR(requestID RequestID) *ReplayXHRParams {
  498. return &ReplayXHRParams{
  499. RequestID: requestID,
  500. }
  501. }
  502. // Do executes Network.replayXHR against the provided context.
  503. func (p *ReplayXHRParams) Do(ctx context.Context) (err error) {
  504. return cdp.Execute(ctx, CommandReplayXHR, p, nil)
  505. }
  506. // SearchInResponseBodyParams searches for given string in response content.
  507. type SearchInResponseBodyParams struct {
  508. RequestID RequestID `json:"requestId"` // Identifier of the network response to search.
  509. Query string `json:"query"` // String to search for.
  510. CaseSensitive bool `json:"caseSensitive"` // If true, search is case sensitive.
  511. IsRegex bool `json:"isRegex"` // If true, treats string parameter as regex.
  512. }
  513. // SearchInResponseBody searches for given string in response content.
  514. //
  515. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-searchInResponseBody
  516. //
  517. // parameters:
  518. //
  519. // requestID - Identifier of the network response to search.
  520. // query - String to search for.
  521. func SearchInResponseBody(requestID RequestID, query string) *SearchInResponseBodyParams {
  522. return &SearchInResponseBodyParams{
  523. RequestID: requestID,
  524. Query: query,
  525. CaseSensitive: false,
  526. IsRegex: false,
  527. }
  528. }
  529. // WithCaseSensitive if true, search is case sensitive.
  530. func (p SearchInResponseBodyParams) WithCaseSensitive(caseSensitive bool) *SearchInResponseBodyParams {
  531. p.CaseSensitive = caseSensitive
  532. return &p
  533. }
  534. // WithIsRegex if true, treats string parameter as regex.
  535. func (p SearchInResponseBodyParams) WithIsRegex(isRegex bool) *SearchInResponseBodyParams {
  536. p.IsRegex = isRegex
  537. return &p
  538. }
  539. // SearchInResponseBodyReturns return values.
  540. type SearchInResponseBodyReturns struct {
  541. Result []*debugger.SearchMatch `json:"result,omitempty,omitzero"` // List of search matches.
  542. }
  543. // Do executes Network.searchInResponseBody against the provided context.
  544. //
  545. // returns:
  546. //
  547. // result - List of search matches.
  548. func (p *SearchInResponseBodyParams) Do(ctx context.Context) (result []*debugger.SearchMatch, err error) {
  549. // execute
  550. var res SearchInResponseBodyReturns
  551. err = cdp.Execute(ctx, CommandSearchInResponseBody, p, &res)
  552. if err != nil {
  553. return nil, err
  554. }
  555. return res.Result, nil
  556. }
  557. // SetBlockedURLsParams blocks URLs from loading.
  558. type SetBlockedURLsParams struct {
  559. URLs []string `json:"urls"` // URL patterns to block. Wildcards ('*') are allowed.
  560. }
  561. // SetBlockedURLs blocks URLs from loading.
  562. //
  563. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setBlockedURLs
  564. //
  565. // parameters:
  566. //
  567. // urls - URL patterns to block. Wildcards ('*') are allowed.
  568. func SetBlockedURLs(urls []string) *SetBlockedURLsParams {
  569. return &SetBlockedURLsParams{
  570. URLs: urls,
  571. }
  572. }
  573. // Do executes Network.setBlockedURLs against the provided context.
  574. func (p *SetBlockedURLsParams) Do(ctx context.Context) (err error) {
  575. return cdp.Execute(ctx, CommandSetBlockedURLs, p, nil)
  576. }
  577. // SetBypassServiceWorkerParams toggles ignoring of service worker for each
  578. // request.
  579. type SetBypassServiceWorkerParams struct {
  580. Bypass bool `json:"bypass"` // Bypass service worker and load from network.
  581. }
  582. // SetBypassServiceWorker toggles ignoring of service worker for each
  583. // request.
  584. //
  585. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setBypassServiceWorker
  586. //
  587. // parameters:
  588. //
  589. // bypass - Bypass service worker and load from network.
  590. func SetBypassServiceWorker(bypass bool) *SetBypassServiceWorkerParams {
  591. return &SetBypassServiceWorkerParams{
  592. Bypass: bypass,
  593. }
  594. }
  595. // Do executes Network.setBypassServiceWorker against the provided context.
  596. func (p *SetBypassServiceWorkerParams) Do(ctx context.Context) (err error) {
  597. return cdp.Execute(ctx, CommandSetBypassServiceWorker, p, nil)
  598. }
  599. // SetCacheDisabledParams toggles ignoring cache for each request. If true,
  600. // cache will not be used.
  601. type SetCacheDisabledParams struct {
  602. CacheDisabled bool `json:"cacheDisabled"` // Cache disabled state.
  603. }
  604. // SetCacheDisabled toggles ignoring cache for each request. If true, cache
  605. // will not be used.
  606. //
  607. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCacheDisabled
  608. //
  609. // parameters:
  610. //
  611. // cacheDisabled - Cache disabled state.
  612. func SetCacheDisabled(cacheDisabled bool) *SetCacheDisabledParams {
  613. return &SetCacheDisabledParams{
  614. CacheDisabled: cacheDisabled,
  615. }
  616. }
  617. // Do executes Network.setCacheDisabled against the provided context.
  618. func (p *SetCacheDisabledParams) Do(ctx context.Context) (err error) {
  619. return cdp.Execute(ctx, CommandSetCacheDisabled, p, nil)
  620. }
  621. // SetCookieParams sets a cookie with the given cookie data; may overwrite
  622. // equivalent cookies if they exist.
  623. type SetCookieParams struct {
  624. Name string `json:"name"` // Cookie name.
  625. Value string `json:"value"` // Cookie value.
  626. URL string `json:"url,omitempty,omitzero"` // The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie.
  627. Domain string `json:"domain,omitempty,omitzero"` // Cookie domain.
  628. Path string `json:"path,omitempty,omitzero"` // Cookie path.
  629. Secure bool `json:"secure"` // True if cookie is secure.
  630. HTTPOnly bool `json:"httpOnly"` // True if cookie is http-only.
  631. SameSite CookieSameSite `json:"sameSite,omitempty,omitzero"` // Cookie SameSite type.
  632. Expires *cdp.TimeSinceEpoch `json:"expires,omitempty,omitzero"` // Cookie expiration date, session cookie if not set
  633. Priority CookiePriority `json:"priority,omitempty,omitzero"` // Cookie Priority type.
  634. SameParty bool `json:"sameParty"` // True if cookie is SameParty.
  635. SourceScheme CookieSourceScheme `json:"sourceScheme,omitempty,omitzero"` // Cookie source scheme type.
  636. SourcePort int64 `json:"sourcePort,omitempty,omitzero"` // Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. This is a temporary ability and it will be removed in the future.
  637. PartitionKey *CookiePartitionKey `json:"partitionKey,omitempty,omitzero"` // Cookie partition key. If not set, the cookie will be set as not partitioned.
  638. }
  639. // SetCookie sets a cookie with the given cookie data; may overwrite
  640. // equivalent cookies if they exist.
  641. //
  642. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookie
  643. //
  644. // parameters:
  645. //
  646. // name - Cookie name.
  647. // value - Cookie value.
  648. func SetCookie(name string, value string) *SetCookieParams {
  649. return &SetCookieParams{
  650. Name: name,
  651. Value: value,
  652. Secure: false,
  653. HTTPOnly: false,
  654. SameParty: false,
  655. }
  656. }
  657. // WithURL the request-URI to associate with the setting of the cookie. This
  658. // value can affect the default domain, path, source port, and source scheme
  659. // values of the created cookie.
  660. func (p SetCookieParams) WithURL(url string) *SetCookieParams {
  661. p.URL = url
  662. return &p
  663. }
  664. // WithDomain cookie domain.
  665. func (p SetCookieParams) WithDomain(domain string) *SetCookieParams {
  666. p.Domain = domain
  667. return &p
  668. }
  669. // WithPath cookie path.
  670. func (p SetCookieParams) WithPath(path string) *SetCookieParams {
  671. p.Path = path
  672. return &p
  673. }
  674. // WithSecure true if cookie is secure.
  675. func (p SetCookieParams) WithSecure(secure bool) *SetCookieParams {
  676. p.Secure = secure
  677. return &p
  678. }
  679. // WithHTTPOnly true if cookie is http-only.
  680. func (p SetCookieParams) WithHTTPOnly(httpOnly bool) *SetCookieParams {
  681. p.HTTPOnly = httpOnly
  682. return &p
  683. }
  684. // WithSameSite cookie SameSite type.
  685. func (p SetCookieParams) WithSameSite(sameSite CookieSameSite) *SetCookieParams {
  686. p.SameSite = sameSite
  687. return &p
  688. }
  689. // WithExpires cookie expiration date, session cookie if not set.
  690. func (p SetCookieParams) WithExpires(expires *cdp.TimeSinceEpoch) *SetCookieParams {
  691. p.Expires = expires
  692. return &p
  693. }
  694. // WithPriority cookie Priority type.
  695. func (p SetCookieParams) WithPriority(priority CookiePriority) *SetCookieParams {
  696. p.Priority = priority
  697. return &p
  698. }
  699. // WithSameParty true if cookie is SameParty.
  700. func (p SetCookieParams) WithSameParty(sameParty bool) *SetCookieParams {
  701. p.SameParty = sameParty
  702. return &p
  703. }
  704. // WithSourceScheme cookie source scheme type.
  705. func (p SetCookieParams) WithSourceScheme(sourceScheme CookieSourceScheme) *SetCookieParams {
  706. p.SourceScheme = sourceScheme
  707. return &p
  708. }
  709. // WithSourcePort cookie source port. Valid values are {-1, [1, 65535]}, -1
  710. // indicates an unspecified port. An unspecified port value allows protocol
  711. // clients to emulate legacy cookie scope for the port. This is a temporary
  712. // ability and it will be removed in the future.
  713. func (p SetCookieParams) WithSourcePort(sourcePort int64) *SetCookieParams {
  714. p.SourcePort = sourcePort
  715. return &p
  716. }
  717. // WithPartitionKey cookie partition key. If not set, the cookie will be set
  718. // as not partitioned.
  719. func (p SetCookieParams) WithPartitionKey(partitionKey *CookiePartitionKey) *SetCookieParams {
  720. p.PartitionKey = partitionKey
  721. return &p
  722. }
  723. // Do executes Network.setCookie against the provided context.
  724. func (p *SetCookieParams) Do(ctx context.Context) (err error) {
  725. return cdp.Execute(ctx, CommandSetCookie, p, nil)
  726. }
  727. // SetCookiesParams sets given cookies.
  728. type SetCookiesParams struct {
  729. Cookies []*CookieParam `json:"cookies"` // Cookies to be set.
  730. }
  731. // SetCookies sets given cookies.
  732. //
  733. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookies
  734. //
  735. // parameters:
  736. //
  737. // cookies - Cookies to be set.
  738. func SetCookies(cookies []*CookieParam) *SetCookiesParams {
  739. return &SetCookiesParams{
  740. Cookies: cookies,
  741. }
  742. }
  743. // Do executes Network.setCookies against the provided context.
  744. func (p *SetCookiesParams) Do(ctx context.Context) (err error) {
  745. return cdp.Execute(ctx, CommandSetCookies, p, nil)
  746. }
  747. // SetExtraHTTPHeadersParams specifies whether to always send extra HTTP
  748. // headers with the requests from this page.
  749. type SetExtraHTTPHeadersParams struct {
  750. Headers Headers `json:"headers"` // Map with extra HTTP headers.
  751. }
  752. // SetExtraHTTPHeaders specifies whether to always send extra HTTP headers
  753. // with the requests from this page.
  754. //
  755. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setExtraHTTPHeaders
  756. //
  757. // parameters:
  758. //
  759. // headers - Map with extra HTTP headers.
  760. func SetExtraHTTPHeaders(headers Headers) *SetExtraHTTPHeadersParams {
  761. return &SetExtraHTTPHeadersParams{
  762. Headers: headers,
  763. }
  764. }
  765. // Do executes Network.setExtraHTTPHeaders against the provided context.
  766. func (p *SetExtraHTTPHeadersParams) Do(ctx context.Context) (err error) {
  767. return cdp.Execute(ctx, CommandSetExtraHTTPHeaders, p, nil)
  768. }
  769. // SetAttachDebugStackParams specifies whether to attach a page script stack
  770. // id in requests.
  771. type SetAttachDebugStackParams struct {
  772. Enabled bool `json:"enabled"` // Whether to attach a page script stack for debugging purpose.
  773. }
  774. // SetAttachDebugStack specifies whether to attach a page script stack id in
  775. // requests.
  776. //
  777. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setAttachDebugStack
  778. //
  779. // parameters:
  780. //
  781. // enabled - Whether to attach a page script stack for debugging purpose.
  782. func SetAttachDebugStack(enabled bool) *SetAttachDebugStackParams {
  783. return &SetAttachDebugStackParams{
  784. Enabled: enabled,
  785. }
  786. }
  787. // Do executes Network.setAttachDebugStack against the provided context.
  788. func (p *SetAttachDebugStackParams) Do(ctx context.Context) (err error) {
  789. return cdp.Execute(ctx, CommandSetAttachDebugStack, p, nil)
  790. }
  791. // StreamResourceContentParams enables streaming of the response for the
  792. // given requestId. If enabled, the dataReceived event contains the data that
  793. // was received during streaming.
  794. type StreamResourceContentParams struct {
  795. RequestID RequestID `json:"requestId"` // Identifier of the request to stream.
  796. }
  797. // StreamResourceContent enables streaming of the response for the given
  798. // requestId. If enabled, the dataReceived event contains the data that was
  799. // received during streaming.
  800. //
  801. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-streamResourceContent
  802. //
  803. // parameters:
  804. //
  805. // requestID - Identifier of the request to stream.
  806. func StreamResourceContent(requestID RequestID) *StreamResourceContentParams {
  807. return &StreamResourceContentParams{
  808. RequestID: requestID,
  809. }
  810. }
  811. // StreamResourceContentReturns return values.
  812. type StreamResourceContentReturns struct {
  813. BufferedData string `json:"bufferedData,omitempty,omitzero"` // Data that has been buffered until streaming is enabled.
  814. }
  815. // Do executes Network.streamResourceContent against the provided context.
  816. //
  817. // returns:
  818. //
  819. // bufferedData - Data that has been buffered until streaming is enabled.
  820. func (p *StreamResourceContentParams) Do(ctx context.Context) (bufferedData []byte, err error) {
  821. // execute
  822. var res StreamResourceContentReturns
  823. err = cdp.Execute(ctx, CommandStreamResourceContent, p, &res)
  824. if err != nil {
  825. return nil, err
  826. }
  827. // decode
  828. var dec []byte
  829. dec, err = base64.StdEncoding.DecodeString(res.BufferedData)
  830. if err != nil {
  831. return nil, err
  832. }
  833. return dec, nil
  834. }
  835. // GetSecurityIsolationStatusParams returns information about the COEP/COOP
  836. // isolation status.
  837. type GetSecurityIsolationStatusParams struct {
  838. FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // If no frameId is provided, the status of the target is provided.
  839. }
  840. // GetSecurityIsolationStatus returns information about the COEP/COOP
  841. // isolation status.
  842. //
  843. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-getSecurityIsolationStatus
  844. //
  845. // parameters:
  846. func GetSecurityIsolationStatus() *GetSecurityIsolationStatusParams {
  847. return &GetSecurityIsolationStatusParams{}
  848. }
  849. // WithFrameID if no frameId is provided, the status of the target is
  850. // provided.
  851. func (p GetSecurityIsolationStatusParams) WithFrameID(frameID cdp.FrameID) *GetSecurityIsolationStatusParams {
  852. p.FrameID = frameID
  853. return &p
  854. }
  855. // GetSecurityIsolationStatusReturns return values.
  856. type GetSecurityIsolationStatusReturns struct {
  857. Status *SecurityIsolationStatus `json:"status,omitempty,omitzero"`
  858. }
  859. // Do executes Network.getSecurityIsolationStatus against the provided context.
  860. //
  861. // returns:
  862. //
  863. // status
  864. func (p *GetSecurityIsolationStatusParams) Do(ctx context.Context) (status *SecurityIsolationStatus, err error) {
  865. // execute
  866. var res GetSecurityIsolationStatusReturns
  867. err = cdp.Execute(ctx, CommandGetSecurityIsolationStatus, p, &res)
  868. if err != nil {
  869. return nil, err
  870. }
  871. return res.Status, nil
  872. }
  873. // EnableReportingAPIParams enables tracking for the Reporting API, events
  874. // generated by the Reporting API will now be delivered to the client. Enabling
  875. // triggers 'reportingApiReportAdded' for all existing reports.
  876. type EnableReportingAPIParams struct {
  877. Enable bool `json:"enable"` // Whether to enable or disable events for the Reporting API
  878. }
  879. // EnableReportingAPI enables tracking for the Reporting API, events
  880. // generated by the Reporting API will now be delivered to the client. Enabling
  881. // triggers 'reportingApiReportAdded' for all existing reports.
  882. //
  883. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-enableReportingApi
  884. //
  885. // parameters:
  886. //
  887. // enable - Whether to enable or disable events for the Reporting API
  888. func EnableReportingAPI(enable bool) *EnableReportingAPIParams {
  889. return &EnableReportingAPIParams{
  890. Enable: enable,
  891. }
  892. }
  893. // Do executes Network.enableReportingApi against the provided context.
  894. func (p *EnableReportingAPIParams) Do(ctx context.Context) (err error) {
  895. return cdp.Execute(ctx, CommandEnableReportingAPI, p, nil)
  896. }
  897. // LoadNetworkResourceParams fetches the resource and returns the content.
  898. type LoadNetworkResourceParams struct {
  899. FrameID cdp.FrameID `json:"frameId,omitempty,omitzero"` // Frame id to get the resource for. Mandatory for frame targets, and should be omitted for worker targets.
  900. URL string `json:"url"` // URL of the resource to get content for.
  901. Options *LoadNetworkResourceOptions `json:"options"` // Options for the request.
  902. }
  903. // LoadNetworkResource fetches the resource and returns the content.
  904. //
  905. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-loadNetworkResource
  906. //
  907. // parameters:
  908. //
  909. // url - URL of the resource to get content for.
  910. // options - Options for the request.
  911. func LoadNetworkResource(url string, options *LoadNetworkResourceOptions) *LoadNetworkResourceParams {
  912. return &LoadNetworkResourceParams{
  913. URL: url,
  914. Options: options,
  915. }
  916. }
  917. // WithFrameID frame id to get the resource for. Mandatory for frame targets,
  918. // and should be omitted for worker targets.
  919. func (p LoadNetworkResourceParams) WithFrameID(frameID cdp.FrameID) *LoadNetworkResourceParams {
  920. p.FrameID = frameID
  921. return &p
  922. }
  923. // LoadNetworkResourceReturns return values.
  924. type LoadNetworkResourceReturns struct {
  925. Resource *LoadNetworkResourcePageResult `json:"resource,omitempty,omitzero"`
  926. }
  927. // Do executes Network.loadNetworkResource against the provided context.
  928. //
  929. // returns:
  930. //
  931. // resource
  932. func (p *LoadNetworkResourceParams) Do(ctx context.Context) (resource *LoadNetworkResourcePageResult, err error) {
  933. // execute
  934. var res LoadNetworkResourceReturns
  935. err = cdp.Execute(ctx, CommandLoadNetworkResource, p, &res)
  936. if err != nil {
  937. return nil, err
  938. }
  939. return res.Resource, nil
  940. }
  941. // SetCookieControlsParams sets Controls for third-party cookie access Page
  942. // reload is required before the new cookie bahavior will be observed.
  943. type SetCookieControlsParams struct {
  944. EnableThirdPartyCookieRestriction bool `json:"enableThirdPartyCookieRestriction"` // Whether 3pc restriction is enabled.
  945. DisableThirdPartyCookieMetadata bool `json:"disableThirdPartyCookieMetadata"` // Whether 3pc grace period exception should be enabled; false by default.
  946. DisableThirdPartyCookieHeuristics bool `json:"disableThirdPartyCookieHeuristics"` // Whether 3pc heuristics exceptions should be enabled; false by default.
  947. }
  948. // SetCookieControls sets Controls for third-party cookie access Page reload
  949. // is required before the new cookie bahavior will be observed.
  950. //
  951. // See: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-setCookieControls
  952. //
  953. // parameters:
  954. //
  955. // enableThirdPartyCookieRestriction - Whether 3pc restriction is enabled.
  956. // disableThirdPartyCookieMetadata - Whether 3pc grace period exception should be enabled; false by default.
  957. // disableThirdPartyCookieHeuristics - Whether 3pc heuristics exceptions should be enabled; false by default.
  958. func SetCookieControls(enableThirdPartyCookieRestriction bool, disableThirdPartyCookieMetadata bool, disableThirdPartyCookieHeuristics bool) *SetCookieControlsParams {
  959. return &SetCookieControlsParams{
  960. EnableThirdPartyCookieRestriction: enableThirdPartyCookieRestriction,
  961. DisableThirdPartyCookieMetadata: disableThirdPartyCookieMetadata,
  962. DisableThirdPartyCookieHeuristics: disableThirdPartyCookieHeuristics,
  963. }
  964. }
  965. // Do executes Network.setCookieControls against the provided context.
  966. func (p *SetCookieControlsParams) Do(ctx context.Context) (err error) {
  967. return cdp.Execute(ctx, CommandSetCookieControls, p, nil)
  968. }
  969. // Command names.
  970. const (
  971. CommandSetAcceptedEncodings = "Network.setAcceptedEncodings"
  972. CommandClearAcceptedEncodingsOverride = "Network.clearAcceptedEncodingsOverride"
  973. CommandClearBrowserCache = "Network.clearBrowserCache"
  974. CommandClearBrowserCookies = "Network.clearBrowserCookies"
  975. CommandDeleteCookies = "Network.deleteCookies"
  976. CommandDisable = "Network.disable"
  977. CommandEmulateNetworkConditions = "Network.emulateNetworkConditions"
  978. CommandEnable = "Network.enable"
  979. CommandGetCertificate = "Network.getCertificate"
  980. CommandGetCookies = "Network.getCookies"
  981. CommandGetResponseBody = "Network.getResponseBody"
  982. CommandGetRequestPostData = "Network.getRequestPostData"
  983. CommandGetResponseBodyForInterception = "Network.getResponseBodyForInterception"
  984. CommandTakeResponseBodyForInterceptionAsStream = "Network.takeResponseBodyForInterceptionAsStream"
  985. CommandReplayXHR = "Network.replayXHR"
  986. CommandSearchInResponseBody = "Network.searchInResponseBody"
  987. CommandSetBlockedURLs = "Network.setBlockedURLs"
  988. CommandSetBypassServiceWorker = "Network.setBypassServiceWorker"
  989. CommandSetCacheDisabled = "Network.setCacheDisabled"
  990. CommandSetCookie = "Network.setCookie"
  991. CommandSetCookies = "Network.setCookies"
  992. CommandSetExtraHTTPHeaders = "Network.setExtraHTTPHeaders"
  993. CommandSetAttachDebugStack = "Network.setAttachDebugStack"
  994. CommandStreamResourceContent = "Network.streamResourceContent"
  995. CommandGetSecurityIsolationStatus = "Network.getSecurityIsolationStatus"
  996. CommandEnableReportingAPI = "Network.enableReportingApi"
  997. CommandLoadNetworkResource = "Network.loadNetworkResource"
  998. CommandSetCookieControls = "Network.setCookieControls"
  999. )