Skip to content

Commit 96b3a8b

Browse files
authored
fix: revert the use of structuredClone (#13044)
1 parent dce61f9 commit 96b3a8b

File tree

1 file changed

+8
-1
lines changed
  • packages/puppeteer-core/src/api

1 file changed

+8
-1
lines changed

packages/puppeteer-core/src/api/Page.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -2494,7 +2494,14 @@ export abstract class Page extends EventEmitter<PageEvents> {
24942494

24952495
await this.bringToFront();
24962496

2497-
const options = structuredClone(userOptions) as ScreenshotOptions;
2497+
const options = {
2498+
...userOptions,
2499+
clip: userOptions.clip
2500+
? {
2501+
...userOptions.clip,
2502+
}
2503+
: undefined,
2504+
};
24982505
if (options.type === undefined && options.path !== undefined) {
24992506
const filePath = options.path;
25002507
// Note we cannot use Node.js here due to browser compatibility.

0 commit comments

Comments
 (0)