Skip to content

Commit ad0dc50

Browse files
authored
修改 setViewport 和 setContent 顺序,经测试,如果要计算 box 宽高的话,这个顺序会有些问题
1 parent cc61e66 commit ad0dc50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ app.use(async ctx => {
99
const browser = await puppeteer.launch()
1010
const page = await browser.newPage()
1111
try {
12-
await page.setContent(html)
1312
await page.setViewport({width: +width, height: 50})
13+
await page.setContent(html)
1414
await page.screenshot({path, fullPage: true})
1515
await browser.close()
1616

0 commit comments

Comments
 (0)