mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: waitForTimeout is not a function (#674)
* fix:issue #673 * fix: 更换延迟函数 * fix: goto改用waitUntil
This commit is contained in:
parent
c622f7eba5
commit
7bbe1a9db1
1 changed files with 1 additions and 2 deletions
|
|
@ -353,12 +353,11 @@ export async function renderUrl (e, url, renderCfg = {}) {
|
|||
const page = await _puppeteer.browser.newPage()
|
||||
let base64
|
||||
try {
|
||||
await page.goto(url, { timeout: 120000 })
|
||||
await page.goto(url, { timeout: 120000 , waitUntil: 'networkidle0' })
|
||||
await page.setViewport(renderCfg.Viewport || {
|
||||
width: 1280,
|
||||
height: 720
|
||||
})
|
||||
await page.waitForTimeout(renderCfg.wait || 1000)
|
||||
let buff = base64 = await page.screenshot({ fullPage: true })
|
||||
base64 = segment.image(buff)
|
||||
await page.close().catch((err) => logger.error(err))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue