testplane 8.42.2 → 8.42.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +1 -1
- package/build/src/base-testplane.d.ts +3 -1
- package/build/src/base-testplane.js +7 -2
- package/build/src/base-testplane.js.map +1 -1
- package/build/src/browser/cdp/domains/css.d.ts +14 -6
- package/build/src/browser/cdp/domains/css.js +4 -0
- package/build/src/browser/cdp/domains/css.js.map +1 -1
- package/build/src/browser/cdp/domains/debugger.d.ts +1 -1
- package/build/src/browser/cdp/domains/fetch.d.ts +157 -3
- package/build/src/browser/cdp/domains/fetch.js +40 -1
- package/build/src/browser/cdp/domains/fetch.js.map +1 -1
- package/build/src/browser/cdp/domains/network.d.ts +284 -18
- package/build/src/browser/cdp/domains/network.js +64 -1
- package/build/src/browser/cdp/domains/network.js.map +1 -1
- package/build/src/browser/cdp/domains/page.d.ts +378 -0
- package/build/src/browser/cdp/domains/page.js +114 -0
- package/build/src/browser/cdp/domains/page.js.map +1 -0
- package/build/src/browser/cdp/emitter.d.ts +2 -1
- package/build/src/browser/cdp/emitter.js +2 -2
- package/build/src/browser/cdp/emitter.js.map +1 -1
- package/build/src/browser/cdp/index.d.ts +2 -0
- package/build/src/browser/cdp/index.js +15 -10
- package/build/src/browser/cdp/index.js.map +1 -1
- package/build/src/browser/cdp/selectivity/css-selectivity.d.ts +4 -0
- package/build/src/browser/cdp/selectivity/css-selectivity.js +55 -47
- package/build/src/browser/cdp/selectivity/css-selectivity.js.map +1 -1
- package/build/src/browser/cdp/selectivity/index.js +47 -7
- package/build/src/browser/cdp/selectivity/index.js.map +1 -1
- package/build/src/browser/cdp/selectivity/js-selectivity.d.ts +4 -1
- package/build/src/browser/cdp/selectivity/js-selectivity.js +76 -68
- package/build/src/browser/cdp/selectivity/js-selectivity.js.map +1 -1
- package/build/src/browser/cdp/types.d.ts +214 -0
- package/build/src/testplane.d.ts +1 -1
- package/build/src/testplane.js +4 -4
- package/build/src/testplane.js.map +1 -1
- package/build/src/worker/testplane.js +1 -1
- package/build/src/worker/testplane.js.map +1 -1
- package/package.json +1 -1
package/build/package.json
CHANGED
|
@@ -5,9 +5,11 @@ import { ConfigInput } from "./config/types";
|
|
|
5
5
|
export declare abstract class BaseTestplane extends AsyncEmitter {
|
|
6
6
|
protected _interceptors: Interceptor[];
|
|
7
7
|
protected _config: Config;
|
|
8
|
+
protected _initEventEmited: boolean;
|
|
8
9
|
static create<T extends BaseTestplane>(this: new (config?: string | ConfigInput) => T, config?: string | ConfigInput): T;
|
|
9
10
|
protected constructor(config?: string | ConfigInput);
|
|
10
|
-
|
|
11
|
+
/** @note Only the first call returns a promise to wait for INIT handlers to complete, subsequent calls return immediately to avoid deadlocks */
|
|
12
|
+
protected _emitInitEventOnce(): Promise<void>;
|
|
11
13
|
get config(): Config;
|
|
12
14
|
get events(): Events;
|
|
13
15
|
get errors(): typeof Errors;
|
|
@@ -17,6 +17,7 @@ class BaseTestplane extends events_1.AsyncEmitter {
|
|
|
17
17
|
constructor(config) {
|
|
18
18
|
super();
|
|
19
19
|
this._interceptors = [];
|
|
20
|
+
this._initEventEmited = false;
|
|
20
21
|
this._interceptors = [];
|
|
21
22
|
(0, typescript_1.registerTransformHook)(this.isWorker());
|
|
22
23
|
this._config = config_1.Config.create(config);
|
|
@@ -24,8 +25,12 @@ class BaseTestplane extends events_1.AsyncEmitter {
|
|
|
24
25
|
this._setLogLevel();
|
|
25
26
|
this._loadPlugins();
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
/** @note Only the first call returns a promise to wait for INIT handlers to complete, subsequent calls return immediately to avoid deadlocks */
|
|
29
|
+
async _emitInitEventOnce() {
|
|
30
|
+
if (this._initEventEmited) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this._initEventEmited = true;
|
|
29
34
|
await this.emitAndWait(events_1.MasterEvents.INIT);
|
|
30
35
|
}
|
|
31
36
|
get config() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-testplane.js","sourceRoot":"","sources":["../../src/base-testplane.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,oEAA2C;AAC3C,qCAAkC;AAClC,qCAQkB;AAClB,sDAA8B;AAC9B,mDAAgF;AAGhF,MAAsB,aAAc,SAAQ,qBAAY;
|
|
1
|
+
{"version":3,"file":"base-testplane.js","sourceRoot":"","sources":["../../src/base-testplane.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,oEAA2C;AAC3C,qCAAkC;AAClC,qCAQkB;AAClB,sDAA8B;AAC9B,mDAAgF;AAGhF,MAAsB,aAAc,SAAQ,qBAAY;IAKpD,MAAM,CAAC,MAAM,CAET,MAA6B;QAE7B,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,YAAsB,MAA6B;QAC/C,KAAK,EAAE,CAAC;QAZF,kBAAa,GAAkB,EAAE,CAAC;QAElC,qBAAgB,GAAY,KAAK,CAAC;QAYxC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAExB,IAAA,kCAAqB,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrC,IAAA,gCAAmB,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,gJAAgJ;IACtI,KAAK,CAAC,kBAAkB;QAC9B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,OAAO;QACX,CAAC;QAED,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,MAAM,IAAI,CAAC,WAAW,CAAC,qBAAY,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,MAAM;QACN,OAAO,gBAAC,CAAC,MAAM,CAAC,EAAE,EAAE,qBAAY,EAAE,qBAAY,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,MAAM;QACN,OAAO,gBAAM,CAAC;IAClB,CAAC;IAED,SAAS,CAAC,KAAuB,EAAE,OAAyB;QACxD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IAChB,CAAC;IAIS,YAAY;QAClB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,gBAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/F,CAAC;IACL,CAAC;IAES,YAAY;QAClB,wBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/D,CAAC;CACJ;AAhED,sCAgEC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { CDPConnection } from "../connection";
|
|
2
2
|
import { CDPEventEmitter } from "../emitter";
|
|
3
3
|
import type { CDPCSSStyleSheetHeader, CDPSessionId, CDPStyleSheetId } from "../types";
|
|
4
|
+
export interface CSSRuleUsage {
|
|
5
|
+
styleSheetId: CDPStyleSheetId;
|
|
6
|
+
startOffset: number;
|
|
7
|
+
endOffset: number;
|
|
8
|
+
used: boolean;
|
|
9
|
+
}
|
|
4
10
|
interface StopRuleUsageTrackingResponse {
|
|
5
|
-
ruleUsage:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
ruleUsage: CSSRuleUsage[];
|
|
12
|
+
}
|
|
13
|
+
interface TakeCoverageDeltaResponse {
|
|
14
|
+
coverage: CSSRuleUsage[];
|
|
15
|
+
/** Monotonically increasing time, in seconds. */
|
|
16
|
+
timestamp: number;
|
|
11
17
|
}
|
|
12
18
|
export interface CssEvents {
|
|
13
19
|
fontsUpdated: {
|
|
@@ -42,5 +48,7 @@ export declare class CDPCss extends CDPEventEmitter<CssEvents> {
|
|
|
42
48
|
startRuleUsageTracking(sessionId: CDPSessionId): Promise<void>;
|
|
43
49
|
/** @link https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-stopRuleUsageTracking */
|
|
44
50
|
stopRuleUsageTracking(sessionId: CDPSessionId): Promise<StopRuleUsageTrackingResponse>;
|
|
51
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-takeCoverageDelta */
|
|
52
|
+
takeCoverageDelta(sessionId: CDPSessionId): Promise<TakeCoverageDeltaResponse>;
|
|
45
53
|
}
|
|
46
54
|
export {};
|
|
@@ -30,6 +30,10 @@ class CDPCss extends emitter_1.CDPEventEmitter {
|
|
|
30
30
|
async stopRuleUsageTracking(sessionId) {
|
|
31
31
|
return this._connection.request("CSS.stopRuleUsageTracking", { sessionId });
|
|
32
32
|
}
|
|
33
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-takeCoverageDelta */
|
|
34
|
+
async takeCoverageDelta(sessionId) {
|
|
35
|
+
return this._connection.request("CSS.takeCoverageDelta", { sessionId });
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
exports.CDPCss = CDPCss;
|
|
35
39
|
//# sourceMappingURL=css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../../../src/browser/cdp/domains/css.ts"],"names":[],"mappings":";;;AACA,wCAA6C;
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../../../src/browser/cdp/domains/css.ts"],"names":[],"mappings":";;;AACA,wCAA6C;AAoC7C,wEAAwE;AACxE,MAAa,MAAO,SAAQ,yBAA0B;IAGlD,YAAmB,UAAyB;QACxC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,yDAAyD;IACzD,sFAAsF;IACtF,KAAK,CAAC,MAAM,CAAC,SAAuB;QAChC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,yDAAyD;IACzD,uFAAuF;IACvF,KAAK,CAAC,OAAO,CAAC,SAAuB;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,iGAAiG;IACjG,KAAK,CAAC,iBAAiB,CAAC,SAAuB,EAAE,YAA6B;QAC1E,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;IACtG,CAAC;IAED,sGAAsG;IACtG,KAAK,CAAC,sBAAsB,CAAC,SAAuB;QAChD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,qGAAqG;IACrG,KAAK,CAAC,qBAAqB,CAAC,SAAuB;QAC/C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,iGAAiG;IACjG,KAAK,CAAC,iBAAiB,CAAC,SAAuB;QAC3C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC;CACJ;AAxCD,wBAwCC"}
|
|
@@ -36,7 +36,7 @@ interface GetScriptSourceResponse {
|
|
|
36
36
|
}
|
|
37
37
|
export interface DebuggerEvents {
|
|
38
38
|
paused: {
|
|
39
|
-
callFrames: CDPDebuggerCallFrame;
|
|
39
|
+
callFrames: CDPDebuggerCallFrame[];
|
|
40
40
|
/** Location of console.profileEnd(). */
|
|
41
41
|
reason: CDPDebuggerPausedReason;
|
|
42
42
|
/** Object containing break-specific auxiliary properties. */
|
|
@@ -1,9 +1,163 @@
|
|
|
1
1
|
import { CDPEventEmitter } from "../emitter";
|
|
2
|
+
import { CDPConnection } from "../connection";
|
|
3
|
+
import type { CDPFrameId, CDPNetworkErrorReason, CDPNetworkRequest, CDPNetworkResourceType, CDPSessionId } from "../types";
|
|
4
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-RequestId */
|
|
5
|
+
type FetchRequestId = string;
|
|
6
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-RequestStage */
|
|
7
|
+
type FetchRequestStage = "Request" | "Response";
|
|
8
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-HeaderEntry */
|
|
9
|
+
interface HeaderEntry {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-AuthChallenge */
|
|
14
|
+
interface AuthChallenge {
|
|
15
|
+
/** Source of the authentication challenge. */
|
|
16
|
+
source?: "Server" | "Proxy";
|
|
17
|
+
/** Origin that issued the authentication challenge. */
|
|
18
|
+
origin: string;
|
|
19
|
+
/** The authentication scheme used, such as basic or digest. */
|
|
20
|
+
scheme: string;
|
|
21
|
+
/** The realm of the challenge. May be empty. */
|
|
22
|
+
realm: string;
|
|
23
|
+
}
|
|
24
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-AuthChallengeResponse */
|
|
25
|
+
interface AuthChallengeResponse {
|
|
26
|
+
/**
|
|
27
|
+
* The decision on what to do in response to the authorization challenge.
|
|
28
|
+
* Default means deferring to the default behavior of the net stack, which will likely either
|
|
29
|
+
* the Cancel authentication or display a popup dialog box.
|
|
30
|
+
*/
|
|
31
|
+
response: "Default" | "CancelAuth" | "ProvideCredentials";
|
|
32
|
+
/** The username to provide, possibly empty. Should only be set if response is ProvideCredentials. */
|
|
33
|
+
username?: string;
|
|
34
|
+
/** The password to provide, possibly empty. Should only be set if response is ProvideCredentials. */
|
|
35
|
+
password?: string;
|
|
36
|
+
}
|
|
37
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#type-RequestPattern */
|
|
38
|
+
interface RequestPattern {
|
|
39
|
+
/** Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*". */
|
|
40
|
+
urlPattern?: string;
|
|
41
|
+
/** If set, only requests for matching resource types will be intercepted. */
|
|
42
|
+
resourceType?: CDPNetworkResourceType;
|
|
43
|
+
/** Stage at which to begin intercepting requests. Default is Request. */
|
|
44
|
+
requestStage?: FetchRequestStage;
|
|
45
|
+
}
|
|
46
|
+
interface EnableRequest {
|
|
47
|
+
/** If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected. */
|
|
48
|
+
patterns?: RequestPattern[];
|
|
49
|
+
/** If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth. */
|
|
50
|
+
handleAuthRequests?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface FailRequestRequest {
|
|
53
|
+
/** An id the client received in requestPaused event. */
|
|
54
|
+
requestId: FetchRequestId;
|
|
55
|
+
/** Causes the request to fail with the given reason. */
|
|
56
|
+
reason: CDPNetworkErrorReason;
|
|
57
|
+
}
|
|
58
|
+
interface FulfillRequestRequest {
|
|
59
|
+
/** An id the client received in requestPaused event. */
|
|
60
|
+
requestId: FetchRequestId;
|
|
61
|
+
/** An HTTP response code. */
|
|
62
|
+
responseCode: number;
|
|
63
|
+
/** Response headers. */
|
|
64
|
+
responseHeaders?: HeaderEntry[];
|
|
65
|
+
/** Alternative way of specifying response headers as a \0-separated series of name: value pairs. Prefer the above method unless you need to represent some non-UTF8 values that can't be transmitted over the protocol as text. (Encoded as a base64 string when passed over JSON) */
|
|
66
|
+
binaryResponseHeaders?: string;
|
|
67
|
+
/** A response body. If absent, original response body will be used if the request is intercepted at the response stage and empty body will be used if the request is intercepted at the request stage. (Encoded as a base64 string when passed over JSON) */
|
|
68
|
+
body?: string;
|
|
69
|
+
/** A textual representation of responseCode. If absent, a standard phrase matching responseCode is used. */
|
|
70
|
+
responsePhrase?: string;
|
|
71
|
+
}
|
|
72
|
+
interface ContinueRequestRequest {
|
|
73
|
+
/** An id the client received in requestPaused event. */
|
|
74
|
+
requestId: FetchRequestId;
|
|
75
|
+
/** If set, the request url will be modified in a way that's not observable by page. */
|
|
76
|
+
url?: string;
|
|
77
|
+
/** If set, the request method will be overridden. */
|
|
78
|
+
method?: string;
|
|
79
|
+
/** If set, overrides the post data in the request. (Encoded as a base64 string when passed over JSON) */
|
|
80
|
+
postData?: string;
|
|
81
|
+
/** If set, overrides the request headers. Note that the overrides do not extend to subsequent redirect hops, if a redirect happens. */
|
|
82
|
+
headers?: HeaderEntry[];
|
|
83
|
+
}
|
|
84
|
+
interface ContinueWithAuthRequest {
|
|
85
|
+
/** An id the client received in authRequired event. */
|
|
86
|
+
requestId: FetchRequestId;
|
|
87
|
+
/** Response to with an authChallenge. */
|
|
88
|
+
authChallengeResponse: AuthChallengeResponse;
|
|
89
|
+
}
|
|
90
|
+
interface GetResponseBodyResponse {
|
|
91
|
+
/** Response body. */
|
|
92
|
+
body: string;
|
|
93
|
+
/** True, if content was sent as base64. */
|
|
94
|
+
base64Encoded: boolean;
|
|
95
|
+
}
|
|
96
|
+
interface TakeResponseBodyAsStreamResponse {
|
|
97
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/IO/#type-StreamHandle */
|
|
98
|
+
stream: string;
|
|
99
|
+
}
|
|
2
100
|
export interface FetchEvents {
|
|
3
|
-
|
|
4
|
-
requestPaused:
|
|
101
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#event-requestPaused */
|
|
102
|
+
requestPaused: {
|
|
103
|
+
/** Each request the page makes will have a unique id. */
|
|
104
|
+
requestId: FetchRequestId;
|
|
105
|
+
/** The details of the request. */
|
|
106
|
+
request: CDPNetworkRequest;
|
|
107
|
+
/** The id of the frame that initiated the request. */
|
|
108
|
+
frameId: CDPFrameId;
|
|
109
|
+
/** How the requested resource will be used. */
|
|
110
|
+
resourceType: CDPNetworkResourceType;
|
|
111
|
+
/** Response error if intercepted at response stage. */
|
|
112
|
+
responseErrorReason?: CDPNetworkErrorReason;
|
|
113
|
+
/** Response code if intercepted at response stage. */
|
|
114
|
+
responseStatusCode?: number;
|
|
115
|
+
/** Response status text if intercepted at response stage. */
|
|
116
|
+
responseStatusText?: string;
|
|
117
|
+
/** Response headers if intercepted at the response stage. */
|
|
118
|
+
responseHeaders?: HeaderEntry[];
|
|
119
|
+
/** 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. */
|
|
120
|
+
networkId?: FetchRequestId;
|
|
121
|
+
};
|
|
122
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#event-authRequired */
|
|
123
|
+
authRequired: {
|
|
124
|
+
/** Each request the page makes will have a unique id. */
|
|
125
|
+
requestId: FetchRequestId;
|
|
126
|
+
/** The details of the request. */
|
|
127
|
+
request: CDPNetworkRequest;
|
|
128
|
+
/** The id of the frame that initiated the request. */
|
|
129
|
+
frameId: CDPFrameId;
|
|
130
|
+
/** How the requested resource will be used. */
|
|
131
|
+
resourceType: CDPNetworkResourceType;
|
|
132
|
+
/** Details of the Authorization Challenge encountered. If this is set, client should respond with continueRequest that contains AuthChallengeResponse. */
|
|
133
|
+
authChallenge: AuthChallenge;
|
|
134
|
+
};
|
|
5
135
|
}
|
|
6
136
|
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/ */
|
|
7
137
|
export declare class CDFetch extends CDPEventEmitter<FetchEvents> {
|
|
8
|
-
|
|
138
|
+
private readonly _connection;
|
|
139
|
+
constructor(connection: CDPConnection);
|
|
140
|
+
/**
|
|
141
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
142
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-enable
|
|
143
|
+
*/
|
|
144
|
+
enable(sessionId: CDPSessionId, params?: EnableRequest): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
147
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-disable
|
|
148
|
+
*/
|
|
149
|
+
disable(sessionId: CDPSessionId): Promise<void>;
|
|
150
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-failRequest */
|
|
151
|
+
failRequest(sessionId: CDPSessionId, params: FailRequestRequest): Promise<void>;
|
|
152
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-fulfillRequest */
|
|
153
|
+
fulfillRequest(sessionId: CDPSessionId, params: FulfillRequestRequest): Promise<void>;
|
|
154
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueRequest */
|
|
155
|
+
continueRequest(sessionId: CDPSessionId, params: ContinueRequestRequest): Promise<void>;
|
|
156
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueWithAuth */
|
|
157
|
+
continueWithAuth(sessionId: CDPSessionId, params: ContinueWithAuthRequest): Promise<void>;
|
|
158
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-getResponseBody */
|
|
159
|
+
getResponseBody(sessionId: CDPSessionId, requestId: FetchRequestId): Promise<GetResponseBodyResponse>;
|
|
160
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-takeResponseBodyAsStream */
|
|
161
|
+
takeResponseBodyAsStream(sessionId: CDPSessionId, requestId: FetchRequestId): Promise<TakeResponseBodyAsStreamResponse>;
|
|
9
162
|
}
|
|
163
|
+
export {};
|
|
@@ -4,8 +4,47 @@ exports.CDFetch = void 0;
|
|
|
4
4
|
const emitter_1 = require("../emitter");
|
|
5
5
|
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/ */
|
|
6
6
|
class CDFetch extends emitter_1.CDPEventEmitter {
|
|
7
|
-
constructor() {
|
|
7
|
+
constructor(connection) {
|
|
8
8
|
super();
|
|
9
|
+
this._connection = connection;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
13
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-enable
|
|
14
|
+
*/
|
|
15
|
+
async enable(sessionId, params) {
|
|
16
|
+
return this._connection.request("Fetch.enable", { sessionId, params });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
20
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-disable
|
|
21
|
+
*/
|
|
22
|
+
async disable(sessionId) {
|
|
23
|
+
return this._connection.request("Fetch.disable", { sessionId });
|
|
24
|
+
}
|
|
25
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-failRequest */
|
|
26
|
+
async failRequest(sessionId, params) {
|
|
27
|
+
return this._connection.request("Fetch.failRequest", { sessionId, params });
|
|
28
|
+
}
|
|
29
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-fulfillRequest */
|
|
30
|
+
async fulfillRequest(sessionId, params) {
|
|
31
|
+
return this._connection.request("Fetch.fulfillRequest", { sessionId, params });
|
|
32
|
+
}
|
|
33
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueRequest */
|
|
34
|
+
async continueRequest(sessionId, params) {
|
|
35
|
+
return this._connection.request("Fetch.continueRequest", { sessionId, params });
|
|
36
|
+
}
|
|
37
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueWithAuth */
|
|
38
|
+
async continueWithAuth(sessionId, params) {
|
|
39
|
+
return this._connection.request("Fetch.continueWithAuth", { sessionId, params });
|
|
40
|
+
}
|
|
41
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-getResponseBody */
|
|
42
|
+
async getResponseBody(sessionId, requestId) {
|
|
43
|
+
return this._connection.request("Fetch.getResponseBody", { sessionId, params: { requestId } });
|
|
44
|
+
}
|
|
45
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-takeResponseBodyAsStream */
|
|
46
|
+
async takeResponseBodyAsStream(sessionId, requestId) {
|
|
47
|
+
return this._connection.request("Fetch.takeResponseBodyAsStream", { sessionId, params: { requestId } });
|
|
9
48
|
}
|
|
10
49
|
}
|
|
11
50
|
exports.CDFetch = CDFetch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../../../src/browser/cdp/domains/fetch.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../../../src/browser/cdp/domains/fetch.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AA4J7C,0EAA0E;AAC1E,MAAa,OAAQ,SAAQ,yBAA4B;IAGrD,YAAmB,UAAyB;QACxC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,SAAuB,EAAE,MAAsB;QACxD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,SAAuB;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,6FAA6F;IAC7F,KAAK,CAAC,WAAW,CAAC,SAAuB,EAAE,MAA0B;QACjE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,gGAAgG;IAChG,KAAK,CAAC,cAAc,CAAC,SAAuB,EAAE,MAA6B;QACvE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,iGAAiG;IACjG,KAAK,CAAC,eAAe,CAAC,SAAuB,EAAE,MAA8B;QACzE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,kGAAkG;IAClG,KAAK,CAAC,gBAAgB,CAAC,SAAuB,EAAE,MAA+B;QAC3E,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,iGAAiG;IACjG,KAAK,CAAC,eAAe,CAAC,SAAuB,EAAE,SAAyB;QACpE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IACnG,CAAC;IAED,0GAA0G;IAC1G,KAAK,CAAC,wBAAwB,CAC1B,SAAuB,EACvB,SAAyB;QAEzB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,gCAAgC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;CACJ;AAzDD,0BAyDC"}
|
|
@@ -1,24 +1,290 @@
|
|
|
1
1
|
import { CDPEventEmitter } from "../emitter";
|
|
2
|
+
import { CDPConnection } from "../connection";
|
|
3
|
+
import type { CDPFrameId, CDPNetworkCookie, CDPNetworkCookieParam, CDPNetworkHeaders, CDPNetworkInitiator, CDPNetworkLoaderId, CDPNetworkMonotonicTime, CDPNetworkRequest, CDPNetworkRequestId, CDPNetworkResourceType, CDPNetworkResponse, CDPNetworkTimeSinceEpoch, CDPNetworkWebSocketFrame, CDPNetworkWebSocketRequest, CDPNetworkWebSocketResponse, CDPSessionId } from "../types";
|
|
4
|
+
interface DeleteCookiesRequest {
|
|
5
|
+
/** Name of the cookies to remove. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** If specified, deletes all the cookies with the given name where domain and path match provided URL. */
|
|
8
|
+
url?: string;
|
|
9
|
+
/** If specified, deletes only cookies with the exact domain. */
|
|
10
|
+
domain?: string;
|
|
11
|
+
/** If specified, deletes only cookies with the exact path. */
|
|
12
|
+
path?: string;
|
|
13
|
+
}
|
|
14
|
+
interface GetCookiesRequest {
|
|
15
|
+
/** The list of URLs for which applicable cookies will be fetched. If not specified, it's assumed to be set to the list of URLs of the pages in the current context. */
|
|
16
|
+
urls?: string[];
|
|
17
|
+
}
|
|
18
|
+
interface GetCookiesResponse {
|
|
19
|
+
/** Array of cookie objects. */
|
|
20
|
+
cookies: CDPNetworkCookie[];
|
|
21
|
+
}
|
|
22
|
+
interface GetResponseBodyResponse {
|
|
23
|
+
/** Response body. */
|
|
24
|
+
body: string;
|
|
25
|
+
/** True, if content was sent as base64. */
|
|
26
|
+
base64Encoded: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface GetRequestPostDataResponse {
|
|
29
|
+
/** Request body string, omitting files from multipart requests. */
|
|
30
|
+
postData: string;
|
|
31
|
+
}
|
|
32
|
+
interface SetCookieRequest {
|
|
33
|
+
/** Cookie name. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Cookie value. */
|
|
36
|
+
value: string;
|
|
37
|
+
/** 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. */
|
|
38
|
+
url?: string;
|
|
39
|
+
/** Cookie domain. */
|
|
40
|
+
domain?: string;
|
|
41
|
+
/** Cookie path. */
|
|
42
|
+
path?: string;
|
|
43
|
+
/** True if cookie is secure. */
|
|
44
|
+
secure?: boolean;
|
|
45
|
+
/** True if cookie is http-only. */
|
|
46
|
+
httpOnly?: boolean;
|
|
47
|
+
/** Cookie SameSite type. */
|
|
48
|
+
sameSite?: "Strict" | "Lax" | "None";
|
|
49
|
+
/** Cookie expiration date, session cookie if not set. */
|
|
50
|
+
expires?: CDPNetworkTimeSinceEpoch;
|
|
51
|
+
/** True if cookie is SameParty. */
|
|
52
|
+
sameParty?: boolean;
|
|
53
|
+
}
|
|
54
|
+
interface EnableRequest {
|
|
55
|
+
maxPostDataSize?: number;
|
|
56
|
+
}
|
|
2
57
|
export interface NetworkEvents {
|
|
3
|
-
dataReceived
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
58
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-dataReceived */
|
|
59
|
+
dataReceived: {
|
|
60
|
+
/** Request identifier. */
|
|
61
|
+
requestId: CDPNetworkRequestId;
|
|
62
|
+
/** Timestamp. */
|
|
63
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
64
|
+
/** Data chunk length. */
|
|
65
|
+
dataLength: number;
|
|
66
|
+
/** Actual bytes received (might be less than dataLength for compressed encodings). */
|
|
67
|
+
encodedDataLength: number;
|
|
68
|
+
};
|
|
69
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-eventSourceMessageReceived */
|
|
70
|
+
eventSourceMessageReceived: {
|
|
71
|
+
/** Request identifier. */
|
|
72
|
+
requestId: CDPNetworkRequestId;
|
|
73
|
+
/** Timestamp. */
|
|
74
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
75
|
+
/** Message type. */
|
|
76
|
+
eventName: string;
|
|
77
|
+
/** Message identifier. */
|
|
78
|
+
eventId: string;
|
|
79
|
+
/** Message content. */
|
|
80
|
+
data: string;
|
|
81
|
+
};
|
|
82
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-loadingFailed */
|
|
83
|
+
loadingFailed: {
|
|
84
|
+
/** Request identifier. */
|
|
85
|
+
requestId: CDPNetworkRequestId;
|
|
86
|
+
/** Timestamp. */
|
|
87
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
88
|
+
/** Resource type. */
|
|
89
|
+
type: CDPNetworkResourceType;
|
|
90
|
+
/** Error message. */
|
|
91
|
+
errorText: string;
|
|
92
|
+
/** True if loading was canceled. */
|
|
93
|
+
canceled?: boolean;
|
|
94
|
+
/** The reason why loading was blocked, if any. */
|
|
95
|
+
blockedReason?: string;
|
|
96
|
+
/** The reason why loading was blocked by CORS, if any. */
|
|
97
|
+
corsErrorStatus?: {
|
|
98
|
+
corsError: string;
|
|
99
|
+
failedParameter: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-loadingFinished */
|
|
103
|
+
loadingFinished: {
|
|
104
|
+
/** Request identifier. */
|
|
105
|
+
requestId: CDPNetworkRequestId;
|
|
106
|
+
/** Timestamp. */
|
|
107
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
108
|
+
/** Total number of bytes received for this request. */
|
|
109
|
+
encodedDataLength: number;
|
|
110
|
+
};
|
|
111
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-requestServedFromCache */
|
|
112
|
+
requestServedFromCache: {
|
|
113
|
+
/** Request identifier. */
|
|
114
|
+
requestId: CDPNetworkRequestId;
|
|
115
|
+
};
|
|
116
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-requestWillBeSent */
|
|
117
|
+
requestWillBeSent: {
|
|
118
|
+
/** Request identifier. */
|
|
119
|
+
requestId: CDPNetworkRequestId;
|
|
120
|
+
/** Loader identifier. Empty string if the request is fetched from worker. */
|
|
121
|
+
loaderId: CDPNetworkLoaderId;
|
|
122
|
+
/** URL of the document this request is loaded for. */
|
|
123
|
+
documentURL: string;
|
|
124
|
+
/** Request data. */
|
|
125
|
+
request: CDPNetworkRequest;
|
|
126
|
+
/** Timestamp. */
|
|
127
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
128
|
+
/** Timestamp. */
|
|
129
|
+
wallTime: CDPNetworkTimeSinceEpoch;
|
|
130
|
+
/** Request initiator. */
|
|
131
|
+
initiator: CDPNetworkInitiator;
|
|
132
|
+
/** Redirect response data. */
|
|
133
|
+
redirectResponse?: CDPNetworkResponse;
|
|
134
|
+
/** Type of this resource. */
|
|
135
|
+
type?: CDPNetworkResourceType;
|
|
136
|
+
/** Frame identifier. */
|
|
137
|
+
frameId?: CDPFrameId;
|
|
138
|
+
/** Whether the request is initiated by a user gesture. Defaults to false. */
|
|
139
|
+
hasUserGesture?: boolean;
|
|
140
|
+
};
|
|
141
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-responseReceived */
|
|
142
|
+
responseReceived: {
|
|
143
|
+
/** Request identifier. */
|
|
144
|
+
requestId: CDPNetworkRequestId;
|
|
145
|
+
/** Loader identifier. Empty string if the request is fetched from worker. */
|
|
146
|
+
loaderId: CDPNetworkLoaderId;
|
|
147
|
+
/** Timestamp. */
|
|
148
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
149
|
+
/** Resource type. */
|
|
150
|
+
type: CDPNetworkResourceType;
|
|
151
|
+
/** Response data. */
|
|
152
|
+
response: CDPNetworkResponse;
|
|
153
|
+
/** Frame identifier. */
|
|
154
|
+
frameId?: CDPFrameId;
|
|
155
|
+
};
|
|
156
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketClosed */
|
|
157
|
+
webSocketClosed: {
|
|
158
|
+
/** Request identifier. */
|
|
159
|
+
requestId: CDPNetworkRequestId;
|
|
160
|
+
/** Timestamp. */
|
|
161
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
162
|
+
};
|
|
163
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketCreated */
|
|
164
|
+
webSocketCreated: {
|
|
165
|
+
/** Request identifier. */
|
|
166
|
+
requestId: CDPNetworkRequestId;
|
|
167
|
+
/** WebSocket request URL. */
|
|
168
|
+
url: string;
|
|
169
|
+
/** Request initiator. */
|
|
170
|
+
initiator?: CDPNetworkInitiator;
|
|
171
|
+
};
|
|
172
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketFrameError */
|
|
173
|
+
webSocketFrameError: {
|
|
174
|
+
/** Request identifier. */
|
|
175
|
+
requestId: CDPNetworkRequestId;
|
|
176
|
+
/** Timestamp. */
|
|
177
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
178
|
+
/** WebSocket error message. */
|
|
179
|
+
errorMessage: string;
|
|
180
|
+
};
|
|
181
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketFrameReceived */
|
|
182
|
+
webSocketFrameReceived: {
|
|
183
|
+
/** Request identifier. */
|
|
184
|
+
requestId: CDPNetworkRequestId;
|
|
185
|
+
/** Timestamp. */
|
|
186
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
187
|
+
/** WebSocket response data. */
|
|
188
|
+
response: CDPNetworkWebSocketFrame;
|
|
189
|
+
};
|
|
190
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketFrameSent */
|
|
191
|
+
webSocketFrameSent: {
|
|
192
|
+
/** Request identifier. */
|
|
193
|
+
requestId: CDPNetworkRequestId;
|
|
194
|
+
/** Timestamp. */
|
|
195
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
196
|
+
/** WebSocket response data. */
|
|
197
|
+
response: CDPNetworkWebSocketFrame;
|
|
198
|
+
};
|
|
199
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketHandshakeResponseReceived */
|
|
200
|
+
webSocketHandshakeResponseReceived: {
|
|
201
|
+
/** Request identifier. */
|
|
202
|
+
requestId: CDPNetworkRequestId;
|
|
203
|
+
/** Timestamp. */
|
|
204
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
205
|
+
/** WebSocket response data. */
|
|
206
|
+
response: CDPNetworkWebSocketResponse;
|
|
207
|
+
};
|
|
208
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webSocketWillSendHandshakeRequest */
|
|
209
|
+
webSocketWillSendHandshakeRequest: {
|
|
210
|
+
/** Request identifier. */
|
|
211
|
+
requestId: CDPNetworkRequestId;
|
|
212
|
+
/** Timestamp. */
|
|
213
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
214
|
+
/** UTC Timestamp. */
|
|
215
|
+
wallTime: CDPNetworkTimeSinceEpoch;
|
|
216
|
+
/** WebSocket request data. */
|
|
217
|
+
request: CDPNetworkWebSocketRequest;
|
|
218
|
+
};
|
|
219
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webTransportCreated */
|
|
220
|
+
webTransportCreated: {
|
|
221
|
+
/** WebTransport identifier. */
|
|
222
|
+
transportId: CDPNetworkRequestId;
|
|
223
|
+
/** WebTransport request URL. */
|
|
224
|
+
url: string;
|
|
225
|
+
/** Timestamp. */
|
|
226
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
227
|
+
/** Request initiator. */
|
|
228
|
+
initiator?: CDPNetworkInitiator;
|
|
229
|
+
};
|
|
230
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webTransportConnectionEstablished */
|
|
231
|
+
webTransportConnectionEstablished: {
|
|
232
|
+
/** WebTransport identifier. */
|
|
233
|
+
transportId: CDPNetworkRequestId;
|
|
234
|
+
/** Timestamp. */
|
|
235
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
236
|
+
};
|
|
237
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-webTransportClosed */
|
|
238
|
+
webTransportClosed: {
|
|
239
|
+
/** WebTransport identifier. */
|
|
240
|
+
transportId: CDPNetworkRequestId;
|
|
241
|
+
/** Timestamp. */
|
|
242
|
+
timestamp: CDPNetworkMonotonicTime;
|
|
243
|
+
};
|
|
20
244
|
}
|
|
21
245
|
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/ */
|
|
22
246
|
export declare class CDPNetwork extends CDPEventEmitter<NetworkEvents> {
|
|
23
|
-
|
|
247
|
+
private readonly _connection;
|
|
248
|
+
constructor(connection: CDPConnection);
|
|
249
|
+
/**
|
|
250
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
251
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-enable
|
|
252
|
+
*/
|
|
253
|
+
enable(sessionId: CDPSessionId, params?: EnableRequest): Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* @param sessionId result of "Target.attachToTarget"
|
|
256
|
+
* @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-disable
|
|
257
|
+
*/
|
|
258
|
+
disable(sessionId: CDPSessionId): Promise<void>;
|
|
259
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-clearBrowserCache */
|
|
260
|
+
clearBrowserCache(sessionId: CDPSessionId): Promise<void>;
|
|
261
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-clearBrowserCookies */
|
|
262
|
+
clearBrowserCookies(sessionId: CDPSessionId): Promise<void>;
|
|
263
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-deleteCookies */
|
|
264
|
+
deleteCookies(sessionId: CDPSessionId, params: DeleteCookiesRequest): Promise<void>;
|
|
265
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getCookies */
|
|
266
|
+
getCookies(sessionId: CDPSessionId, params?: GetCookiesRequest): Promise<GetCookiesResponse>;
|
|
267
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getResponseBody */
|
|
268
|
+
getResponseBody(sessionId: CDPSessionId, requestId: CDPNetworkRequestId): Promise<GetResponseBodyResponse>;
|
|
269
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getRequestPostData */
|
|
270
|
+
getRequestPostData(sessionId: CDPSessionId, requestId: CDPNetworkRequestId): Promise<GetRequestPostDataResponse>;
|
|
271
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setBypassServiceWorker */
|
|
272
|
+
setBypassServiceWorker(sessionId: CDPSessionId, bypass: boolean): Promise<void>;
|
|
273
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setCacheDisabled */
|
|
274
|
+
setCacheDisabled(sessionId: CDPSessionId, cacheDisabled: boolean): Promise<void>;
|
|
275
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setCookie */
|
|
276
|
+
setCookie(sessionId: CDPSessionId, params: SetCookieRequest): Promise<{
|
|
277
|
+
success: boolean;
|
|
278
|
+
}>;
|
|
279
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setCookies */
|
|
280
|
+
setCookies(sessionId: CDPSessionId, cookies: CDPNetworkCookieParam[]): Promise<void>;
|
|
281
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setExtraHTTPHeaders */
|
|
282
|
+
setExtraHTTPHeaders(sessionId: CDPSessionId, headers: CDPNetworkHeaders): Promise<void>;
|
|
283
|
+
/** @link https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-setUserAgentOverride */
|
|
284
|
+
setUserAgentOverride(sessionId: CDPSessionId, params: {
|
|
285
|
+
userAgent: string;
|
|
286
|
+
acceptLanguage?: string;
|
|
287
|
+
platform?: string;
|
|
288
|
+
}): Promise<void>;
|
|
24
289
|
}
|
|
290
|
+
export {};
|