Skip to content

Commit

Permalink
Fix large pdf generation #4
Browse files Browse the repository at this point in the history
  • Loading branch information
clementmas committed Nov 29, 2023
1 parent 3cea090 commit d1088bc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bin/browser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -383,24 +383,20 @@ const callChrome = async pup => {
await page.waitForSelector(request.options.waitForSelector, (request.options.waitForSelectorOptions ? request.options.waitForSelectorOptions : undefined));
}

const output = await getOutput(request, page);

if (!request.options.path) {
console.log(output);
}
console.log(await getOutput(request, page));

if (remoteInstance && page) {
await page.close();
}

await remoteInstance ? browser.disconnect() : browser.close();
await (remoteInstance ? browser.disconnect() : browser.close());
} catch (exception) {
if (browser) {
if (remoteInstance && page) {
await page.close();
}

(await remoteInstance) ? browser.disconnect() : browser.close();
await (remoteInstance ? browser.disconnect() : browser.close());
}

const output = await getOutput(request);
Expand Down

0 comments on commit d1088bc

Please sign in to comment.