events.go 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package fetch
  2. // Code generated by cdproto-gen. DO NOT EDIT.
  3. import (
  4. "github.com/chromedp/cdproto/cdp"
  5. "github.com/chromedp/cdproto/network"
  6. )
  7. // EventRequestPaused issued when the domain is enabled and the request URL
  8. // matches the specified filter. The request is paused until the client responds
  9. // with one of continueRequest, failRequest or fulfillRequest. The stage of the
  10. // request can be determined by presence of responseErrorReason and
  11. // responseStatusCode -- the request is at the response stage if either of these
  12. // fields is present and in the request stage otherwise. Redirect responses and
  13. // subsequent requests are reported similarly to regular responses and requests.
  14. // Redirect responses may be distinguished by the value of responseStatusCode
  15. // (which is one of 301, 302, 303, 307, 308) along with presence of the location
  16. // header. Requests resulting from a redirect will have redirectedRequestId
  17. // field set.
  18. //
  19. // See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#event-requestPaused
  20. type EventRequestPaused struct {
  21. RequestID RequestID `json:"requestId"` // Each request the page makes will have a unique id.
  22. Request *network.Request `json:"request"` // The details of the request.
  23. FrameID cdp.FrameID `json:"frameId"` // The id of the frame that initiated the request.
  24. ResourceType network.ResourceType `json:"resourceType"` // How the requested resource will be used.
  25. ResponseErrorReason network.ErrorReason `json:"responseErrorReason,omitempty"` // Response error if intercepted at response stage.
  26. ResponseStatusCode int64 `json:"responseStatusCode,omitempty"` // Response code if intercepted at response stage.
  27. ResponseStatusText string `json:"responseStatusText,omitempty"` // Response status text if intercepted at response stage.
  28. ResponseHeaders []*HeaderEntry `json:"responseHeaders,omitempty"` // Response headers if intercepted at the response stage.
  29. NetworkID network.RequestID `json:"networkId,omitempty"` // If the intercepted request had a corresponding Network.requestWillBeSent event fired for it, then this networkId will be the same as the requestId present in the requestWillBeSent event.
  30. RedirectedRequestID RequestID `json:"redirectedRequestId,omitempty"` // If the request is due to a redirect response from the server, the id of the request that has caused the redirect.
  31. }
  32. // EventAuthRequired issued when the domain is enabled with
  33. // handleAuthRequests set to true. The request is paused until client responds
  34. // with continueWithAuth.
  35. //
  36. // See: https://chromedevtools.github.io/devtools-protocol/tot/Fetch#event-authRequired
  37. type EventAuthRequired struct {
  38. RequestID RequestID `json:"requestId"` // Each request the page makes will have a unique id.
  39. Request *network.Request `json:"request"` // The details of the request.
  40. FrameID cdp.FrameID `json:"frameId"` // The id of the frame that initiated the request.
  41. ResourceType network.ResourceType `json:"resourceType"` // How the requested resource will be used.
  42. AuthChallenge *AuthChallenge `json:"authChallenge"` // Details of the Authorization Challenge encountered. If this is set, client should respond with continueRequest that contains AuthChallengeResponse.
  43. }