/
event.go
55 lines (46 loc) · 2.05 KB
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package fetch
import (
"github.com/diiyw/cuto/protocol/network"
"github.com/diiyw/cuto/protocol/cdp"
)
// Issued when the domain is enabled and the request URL matches the
// specified filter. The request is paused until the client responds
// with one of continueRequest, failRequest or fulfillRequest.
// The stage of the request can be determined by presence of responseErrorReason
// and responseStatusCode -- the request is at the response stage if either
// of these fields is present and in the request stage otherwise.
const RequestPausedEvent = "Fetch.requestPaused"
type RequestPausedParams struct {
// Each request the page makes will have a unique id.
RequestId RequestId
// The details of the request.
Request network.Request
// The id of the frame that initiated the request.
FrameId cdp.FrameId
// How the requested resource will be used.
ResourceType network.ResourceType
// Response error if intercepted at response stage.
ResponseErrorReason network.ErrorReason
// Response code if intercepted at response stage.
ResponseStatusCode int
// Response headers if intercepted at the response stage.
ResponseHeaders []*HeaderEntry
// 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.
NetworkId RequestId}
// Issued when the domain is enabled with handleAuthRequests set to true.
// The request is paused until client responds with continueWithAuth.
const AuthRequiredEvent = "Fetch.authRequired"
type AuthRequiredParams struct {
// Each request the page makes will have a unique id.
RequestId RequestId
// The details of the request.
Request network.Request
// The id of the frame that initiated the request.
FrameId cdp.FrameId
// How the requested resource will be used.
ResourceType network.ResourceType
// Details of the Authorization Challenge encountered.
// If this is set, client should respond with continueRequest that
// contains AuthChallengeResponse.
AuthChallenge AuthChallenge}