brave-real-puppeteer-core 24.25.0 → 24.26.1
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/README.md +5 -5
- package/advanced-stealth.js +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js +1 -1
- package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/cjs/puppeteer/api/Frame.js +4 -4
- package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/cjs/puppeteer/api/Page.d.ts +2 -2
- package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Browser.js +20 -14
- package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/Connection.js +16 -0
- package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js +2 -4
- package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/cjs/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/cjs/puppeteer/bidi/core/Request.js +30 -4
- package/lib/cjs/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts +4 -0
- package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/Accessibility.js +19 -0
- package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js +2 -1
- package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/cjs/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/Page.js +1 -1
- package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/lib/cjs/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/lib/cjs/puppeteer/revisions.js +2 -2
- package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/lib/cjs/puppeteer/util/version.js +1 -1
- package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -3
- package/lib/es5-iife/puppeteer-core-browser.js +31 -12
- package/lib/esm/puppeteer/api/ElementHandle.js +1 -1
- package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/lib/esm/puppeteer/api/Frame.js +4 -4
- package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/lib/esm/puppeteer/api/HTTPRequest.d.ts +1 -1
- package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Browser.js +20 -14
- package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/Connection.js +16 -0
- package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/HTTPRequest.js +2 -4
- package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.d.ts +1 -0
- package/lib/esm/puppeteer/bidi/core/Request.d.ts.map +1 -1
- package/lib/esm/puppeteer/bidi/core/Request.js +31 -5
- package/lib/esm/puppeteer/bidi/core/Request.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts +4 -0
- package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/Accessibility.js +19 -0
- package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.js +2 -1
- package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js +1 -1
- package/lib/esm/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/lib/esm/puppeteer/cdp/JSHandle.js.map +1 -1
- package/lib/esm/puppeteer/cdp/Page.js +1 -1
- package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/lib/esm/puppeteer/cdp/utils.d.ts +2 -2
- package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
- package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/lib/esm/puppeteer/revisions.js +2 -2
- package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/lib/esm/puppeteer/util/version.js +1 -1
- package/lib/types.d.ts +7 -3
- package/package.json +13 -13
- package/src/api/ElementHandle.ts +1 -1
- package/src/api/Frame.ts +4 -4
- package/src/api/HTTPRequest.ts +1 -1
- package/src/api/Page.ts +2 -2
- package/src/bidi/Browser.ts +24 -14
- package/src/bidi/Connection.ts +16 -0
- package/src/bidi/HTTPRequest.ts +2 -4
- package/src/bidi/core/Request.ts +35 -5
- package/src/cdp/Accessibility.ts +28 -1
- package/src/cdp/ExecutionContext.ts +6 -2
- package/src/cdp/HTTPRequest.ts +2 -1
- package/src/cdp/HTTPResponse.ts +1 -1
- package/src/cdp/JSHandle.ts +1 -1
- package/src/cdp/Page.ts +1 -1
- package/src/cdp/utils.ts +2 -2
- package/src/revisions.ts +2 -2
- package/src/util/version.ts +1 -1
package/src/api/Page.ts
CHANGED
|
@@ -507,7 +507,7 @@ export const enum PageEvent {
|
|
|
507
507
|
Metrics = 'metrics',
|
|
508
508
|
/**
|
|
509
509
|
* Emitted when an uncaught exception happens within the page. Contains an
|
|
510
|
-
* `Error
|
|
510
|
+
* `Error` or data of type unknown.
|
|
511
511
|
*/
|
|
512
512
|
PageError = 'pageerror',
|
|
513
513
|
/**
|
|
@@ -602,7 +602,7 @@ export interface PageEvents extends Record<EventType, unknown> {
|
|
|
602
602
|
[PageEvent.FrameNavigated]: Frame;
|
|
603
603
|
[PageEvent.Load]: undefined;
|
|
604
604
|
[PageEvent.Metrics]: {title: string; metrics: Metrics};
|
|
605
|
-
[PageEvent.PageError]: Error;
|
|
605
|
+
[PageEvent.PageError]: Error | unknown;
|
|
606
606
|
[PageEvent.Popup]: Page | null;
|
|
607
607
|
[PageEvent.Request]: HTTPRequest;
|
|
608
608
|
[PageEvent.Response]: HTTPResponse;
|
package/src/bidi/Browser.ts
CHANGED
|
@@ -89,6 +89,8 @@ export class BidiBrowser extends Browser {
|
|
|
89
89
|
// yet because WebDriver BiDi behavior is not specified. See
|
|
90
90
|
// https://github.com/w3c/webdriver-bidi/issues/321.
|
|
91
91
|
'goog:prerenderingDisabled': true,
|
|
92
|
+
// TODO: remove after Puppeteer rolled Chrome to 142 after Oct 28, 2025.
|
|
93
|
+
'goog:disableNetworkDurableMessages': true,
|
|
92
94
|
},
|
|
93
95
|
});
|
|
94
96
|
|
|
@@ -109,20 +111,28 @@ export class BidiBrowser extends Browser {
|
|
|
109
111
|
}) as [string, ...string[]],
|
|
110
112
|
);
|
|
111
113
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
await Promise.all(
|
|
115
|
+
[Bidi.Network.DataType.Request, Bidi.Network.DataType.Response].map(
|
|
116
|
+
// Data collectors might be not implemented for specific data type, so create them
|
|
117
|
+
// separately and ignore protocol errors.
|
|
118
|
+
async dataType => {
|
|
119
|
+
try {
|
|
120
|
+
await session.send('network.addDataCollector', {
|
|
121
|
+
dataTypes: [dataType],
|
|
122
|
+
// Buffer size of 20 MB is equivalent to the CDP:
|
|
123
|
+
maxEncodedDataSize: 20_000_000,
|
|
124
|
+
});
|
|
125
|
+
} catch (err) {
|
|
126
|
+
if (err instanceof ProtocolError) {
|
|
127
|
+
debugError(err);
|
|
128
|
+
} else {
|
|
129
|
+
throw err;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
|
|
126
136
|
const browser = new BidiBrowser(session.browser, opts);
|
|
127
137
|
browser.#initialize();
|
|
128
138
|
return browser;
|
package/src/bidi/Connection.ts
CHANGED
|
@@ -88,10 +88,26 @@ export class BidiConnection
|
|
|
88
88
|
this.#emitters.push(emitter);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
#toWebDriverOnlyEvent(event: Record<string, any>) {
|
|
92
|
+
for (const key in event) {
|
|
93
|
+
if (key.startsWith('goog:')) {
|
|
94
|
+
delete event[key];
|
|
95
|
+
} else {
|
|
96
|
+
if (typeof event[key] === 'object' && event[key] !== null) {
|
|
97
|
+
this.#toWebDriverOnlyEvent(event[key]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
override emit<Key extends keyof EventsWithWildcard<BidiEvents>>(
|
|
92
104
|
type: Key,
|
|
93
105
|
event: EventsWithWildcard<BidiEvents>[Key],
|
|
94
106
|
): boolean {
|
|
107
|
+
if (process.env['PUPPETEER_WEBDRIVER_BIDI_ONLY'] === 'true') {
|
|
108
|
+
// Required for WebDriver-only testing.
|
|
109
|
+
this.#toWebDriverOnlyEvent(event);
|
|
110
|
+
}
|
|
95
111
|
for (const emitter of this.#emitters) {
|
|
96
112
|
emitter.emit(type, event);
|
|
97
113
|
}
|
package/src/bidi/HTTPRequest.ts
CHANGED
|
@@ -158,14 +158,11 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
override hasPostData(): boolean {
|
|
161
|
-
if (!this.#frame.page().browser().cdpSupported) {
|
|
162
|
-
throw new UnsupportedOperation();
|
|
163
|
-
}
|
|
164
161
|
return this.#request.hasPostData;
|
|
165
162
|
}
|
|
166
163
|
|
|
167
164
|
override async fetchPostData(): Promise<string | undefined> {
|
|
168
|
-
|
|
165
|
+
return await this.#request.fetchPostData();
|
|
169
166
|
}
|
|
170
167
|
|
|
171
168
|
get #hasInternalHeaderOverwrite(): boolean {
|
|
@@ -184,6 +181,7 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
184
181
|
}
|
|
185
182
|
|
|
186
183
|
override headers(): Record<string, string> {
|
|
184
|
+
// Callers should not be allowed to mutate internal structure.
|
|
187
185
|
const headers: Record<string, string> = {};
|
|
188
186
|
for (const header of this.#request.headers) {
|
|
189
187
|
headers[header.name.toLowerCase()] = header.value.value;
|
package/src/bidi/core/Request.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import * as Bidi from 'webdriver-bidi-protocol';
|
|
8
8
|
|
|
9
|
-
import {ProtocolError} from '../../common/Errors.js';
|
|
9
|
+
import {ProtocolError, UnsupportedOperation} from '../../common/Errors.js';
|
|
10
10
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
11
11
|
import {inertIfDisposed} from '../../util/decorators.js';
|
|
12
12
|
import {DisposableStack, disposeSymbol} from '../../util/disposable.js';
|
|
@@ -37,6 +37,7 @@ export class Request extends EventEmitter<{
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
#responseContentPromise: Promise<Uint8Array<ArrayBufferLike>> | null = null;
|
|
40
|
+
#requestBodyPromise: Promise<string> | null = null;
|
|
40
41
|
#error?: string;
|
|
41
42
|
#redirect?: Request;
|
|
42
43
|
#response?: Bidi.Network.ResponseData;
|
|
@@ -153,7 +154,14 @@ export class Request extends EventEmitter<{
|
|
|
153
154
|
return this.#event.request.request;
|
|
154
155
|
}
|
|
155
156
|
get initiator(): Bidi.Network.Initiator | undefined {
|
|
156
|
-
return
|
|
157
|
+
return {
|
|
158
|
+
...this.#event.initiator,
|
|
159
|
+
// Initiator URL is not specified in BiDi.
|
|
160
|
+
// @ts-expect-error non-standard property.
|
|
161
|
+
url: this.#event.request['goog:resourceInitiator']?.url,
|
|
162
|
+
// @ts-expect-error non-standard property.
|
|
163
|
+
stack: this.#event.request['goog:resourceInitiator']?.stack,
|
|
164
|
+
};
|
|
157
165
|
}
|
|
158
166
|
get method(): string {
|
|
159
167
|
return this.#event.request.method;
|
|
@@ -195,8 +203,7 @@ export class Request extends EventEmitter<{
|
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
get hasPostData(): boolean {
|
|
198
|
-
|
|
199
|
-
return this.#event.request['goog:hasPostData'] ?? false;
|
|
206
|
+
return (this.#event.request.bodySize ?? 0) > 0;
|
|
200
207
|
}
|
|
201
208
|
|
|
202
209
|
async continueRequest({
|
|
@@ -237,6 +244,29 @@ export class Request extends EventEmitter<{
|
|
|
237
244
|
});
|
|
238
245
|
}
|
|
239
246
|
|
|
247
|
+
async fetchPostData(): Promise<string | undefined> {
|
|
248
|
+
if (!this.hasPostData) {
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
if (!this.#requestBodyPromise) {
|
|
252
|
+
this.#requestBodyPromise = (async () => {
|
|
253
|
+
const data = await this.#session.send('network.getData', {
|
|
254
|
+
dataType: Bidi.Network.DataType.Request,
|
|
255
|
+
request: this.id,
|
|
256
|
+
});
|
|
257
|
+
if (data.result.bytes.type === 'string') {
|
|
258
|
+
return data.result.bytes.value;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// TODO: support base64 response.
|
|
262
|
+
throw new UnsupportedOperation(
|
|
263
|
+
`Collected request body data of type ${data.result.bytes.type} is not supported`,
|
|
264
|
+
);
|
|
265
|
+
})();
|
|
266
|
+
}
|
|
267
|
+
return await this.#requestBodyPromise;
|
|
268
|
+
}
|
|
269
|
+
|
|
240
270
|
async getResponseContent(): Promise<Uint8Array> {
|
|
241
271
|
if (!this.#responseContentPromise) {
|
|
242
272
|
this.#responseContentPromise = (async () => {
|
|
@@ -258,7 +288,7 @@ export class Request extends EventEmitter<{
|
|
|
258
288
|
)
|
|
259
289
|
) {
|
|
260
290
|
throw new ProtocolError(
|
|
261
|
-
'Could not load body for this request. This might happen if the request is a preflight request.',
|
|
291
|
+
'Could not load response body for this request. This might happen if the request is a preflight request.',
|
|
262
292
|
);
|
|
263
293
|
}
|
|
264
294
|
|
package/src/cdp/Accessibility.ts
CHANGED
|
@@ -76,6 +76,11 @@ export interface SerializedAXNode {
|
|
|
76
76
|
*/
|
|
77
77
|
invalid?: string;
|
|
78
78
|
orientation?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Url for link elements.
|
|
82
|
+
*/
|
|
83
|
+
url?: string;
|
|
79
84
|
/**
|
|
80
85
|
* Children of this node, if there are any.
|
|
81
86
|
*/
|
|
@@ -460,12 +465,32 @@ class AXNode {
|
|
|
460
465
|
}
|
|
461
466
|
}
|
|
462
467
|
|
|
468
|
+
public isLandmark(): boolean {
|
|
469
|
+
switch (this.#role) {
|
|
470
|
+
case 'banner':
|
|
471
|
+
case 'complementary':
|
|
472
|
+
case 'contentinfo':
|
|
473
|
+
case 'form':
|
|
474
|
+
case 'main':
|
|
475
|
+
case 'navigation':
|
|
476
|
+
case 'region':
|
|
477
|
+
case 'search':
|
|
478
|
+
return true;
|
|
479
|
+
default:
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
463
484
|
public isInteresting(insideControl: boolean): boolean {
|
|
464
485
|
const role = this.#role;
|
|
465
486
|
if (role === 'Ignored' || this.#hidden || this.#ignored) {
|
|
466
487
|
return false;
|
|
467
488
|
}
|
|
468
489
|
|
|
490
|
+
if (this.isLandmark()) {
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
|
|
469
494
|
if (this.#focusable || this.#richlyEditable) {
|
|
470
495
|
return true;
|
|
471
496
|
}
|
|
@@ -522,7 +547,8 @@ class AXNode {
|
|
|
522
547
|
| 'description'
|
|
523
548
|
| 'keyshortcuts'
|
|
524
549
|
| 'roledescription'
|
|
525
|
-
| 'valuetext'
|
|
550
|
+
| 'valuetext'
|
|
551
|
+
| 'url';
|
|
526
552
|
|
|
527
553
|
const userStringProperties: UserStringProperty[] = [
|
|
528
554
|
'name',
|
|
@@ -531,6 +557,7 @@ class AXNode {
|
|
|
531
557
|
'keyshortcuts',
|
|
532
558
|
'roledescription',
|
|
533
559
|
'valuetext',
|
|
560
|
+
'url',
|
|
534
561
|
];
|
|
535
562
|
const getUserStringPropertyValue = (key: UserStringProperty): string => {
|
|
536
563
|
return properties.get(key) as string;
|
|
@@ -597,7 +597,9 @@ export class ExecutionContext
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
if (returnByValue) {
|
|
600
|
-
return valueFromRemoteObject(remoteObject)
|
|
600
|
+
return valueFromRemoteObject(remoteObject) as HandleFor<
|
|
601
|
+
Awaited<ReturnType<Func>>
|
|
602
|
+
>;
|
|
601
603
|
}
|
|
602
604
|
|
|
603
605
|
return this.#world.createCdpHandle(remoteObject) as HandleFor<
|
|
@@ -649,7 +651,9 @@ export class ExecutionContext
|
|
|
649
651
|
}
|
|
650
652
|
|
|
651
653
|
if (returnByValue) {
|
|
652
|
-
return valueFromRemoteObject(remoteObject)
|
|
654
|
+
return valueFromRemoteObject(remoteObject) as unknown as HandleFor<
|
|
655
|
+
Awaited<ReturnType<Func>>
|
|
656
|
+
>;
|
|
653
657
|
}
|
|
654
658
|
|
|
655
659
|
return this.#world.createCdpHandle(remoteObject) as HandleFor<
|
package/src/cdp/HTTPRequest.ts
CHANGED
|
@@ -138,7 +138,8 @@ export class CdpHTTPRequest extends HTTPRequest {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
override headers(): Record<string, string> {
|
|
141
|
-
|
|
141
|
+
// Callers should not be allowed to mutate internal structure.
|
|
142
|
+
return structuredClone(this.#headers);
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
override response(): CdpHTTPResponse | null {
|
package/src/cdp/HTTPResponse.ts
CHANGED
|
@@ -139,7 +139,7 @@ export class CdpHTTPResponse extends HTTPResponse {
|
|
|
139
139
|
'No resource with given identifier found'
|
|
140
140
|
) {
|
|
141
141
|
throw new ProtocolError(
|
|
142
|
-
'Could not load body for this request. This might happen if the request is a preflight request.',
|
|
142
|
+
'Could not load response body for this request. This might happen if the request is a preflight request.',
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
|
package/src/cdp/JSHandle.ts
CHANGED
|
@@ -45,7 +45,7 @@ export class CdpJSHandle<T = unknown> extends JSHandle<T> {
|
|
|
45
45
|
|
|
46
46
|
override async jsonValue(): Promise<T> {
|
|
47
47
|
if (!this.#remoteObject.objectId) {
|
|
48
|
-
return valueFromRemoteObject(this.#remoteObject);
|
|
48
|
+
return valueFromRemoteObject(this.#remoteObject) as T;
|
|
49
49
|
}
|
|
50
50
|
const value = await this.evaluate(object => {
|
|
51
51
|
return object;
|
package/src/cdp/Page.ts
CHANGED
|
@@ -859,7 +859,7 @@ export class CdpPage extends Page {
|
|
|
859
859
|
}
|
|
860
860
|
const textTokens = [];
|
|
861
861
|
// eslint-disable-next-line max-len -- The comment is long.
|
|
862
|
-
// eslint-disable-next-line
|
|
862
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
863
863
|
for (const arg of args) {
|
|
864
864
|
const remoteObject = arg.remoteObject();
|
|
865
865
|
if (remoteObject.objectId) {
|
package/src/cdp/utils.ts
CHANGED
|
@@ -94,7 +94,7 @@ const getErrorDetails = (details: Protocol.Runtime.ExceptionDetails) => {
|
|
|
94
94
|
*/
|
|
95
95
|
export function createClientError(
|
|
96
96
|
details: Protocol.Runtime.ExceptionDetails,
|
|
97
|
-
): Error {
|
|
97
|
+
): Error | unknown {
|
|
98
98
|
let name: string;
|
|
99
99
|
let message: string;
|
|
100
100
|
if (!details.exception) {
|
|
@@ -141,7 +141,7 @@ export function createClientError(
|
|
|
141
141
|
*/
|
|
142
142
|
export function valueFromRemoteObject(
|
|
143
143
|
remoteObject: Protocol.Runtime.RemoteObject,
|
|
144
|
-
):
|
|
144
|
+
): unknown {
|
|
145
145
|
assert(!remoteObject.objectId, 'Cannot extract value when objectId is given');
|
|
146
146
|
if (remoteObject.unserializableValue) {
|
|
147
147
|
if (remoteObject.type === 'bigint') {
|
package/src/revisions.ts
CHANGED
package/src/util/version.ts
CHANGED