Skip to content

Commit

Permalink
add small nits
Browse files Browse the repository at this point in the history
  • Loading branch information
thatkookooguy committed Oct 21, 2023
1 parent e983d17 commit 4be015b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/image-maker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,25 @@ export class SvgMaker {
this.templateFilePath || (this.options.templateFile as string);
const browser = await puppeteer.launch({
headless: "new",
timeout: 0,
});
const page = await browser.newPage();
await page.setViewport({
height: this.options.height,
width: this.options.width,
});
await page.goto("file://" + this.templateFilePath);
await page.goto("file://" + this.templateFilePath, {
waitUntil: "networkidle0",
timeout: 0,
});
await page.addScriptTag({
content: `
activate(${JSON.stringify(this.options.data)})
`,
});
const imageBuffer = await page.screenshot({});
const imageBuffer = await page.screenshot({
omitBackground: true,
});

await browser.close();

Expand Down

0 comments on commit 4be015b

Please sign in to comment.