Skip to content

Commit

Permalink
fix: revert the use of structuredClone (#13044)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN authored Sep 4, 2024
1 parent dce61f9 commit 96b3a8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/puppeteer-core/src/api/Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,14 @@ export abstract class Page extends EventEmitter<PageEvents> {

await this.bringToFront();

const options = structuredClone(userOptions) as ScreenshotOptions;
const options = {
...userOptions,
clip: userOptions.clip
? {
...userOptions.clip,
}
: undefined,
};
if (options.type === undefined && options.path !== undefined) {
const filePath = options.path;
// Note we cannot use Node.js here due to browser compatibility.
Expand Down

0 comments on commit 96b3a8b

Please sign in to comment.