fix(plugins/community/screenshot): wait for idle network and dom loaded [skip ci]

This commit is contained in:
lowlighter
2022-11-20 06:46:30 -05:00
parent b547761e87
commit 7d7e9d63a7

View File

@@ -18,7 +18,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
const page = await browser.newPage() const page = await browser.newPage()
await page.setViewport({width: 1280, height: 1280}) await page.setViewport({width: 1280, height: 1280})
console.debug(`metrics/compute/${login}/plugins > screenshot > loading ${url}`) console.debug(`metrics/compute/${login}/plugins > screenshot > loading ${url}`)
await page.goto(url) await page.goto(url, {waitUntil:["domcontentloaded", "networkidle2"]})
//Screenshot //Screenshot
await page.waitForSelector(selector) await page.waitForSelector(selector)