保存视觉审核与文档流迁移进度
This commit is contained in:
@@ -520,12 +520,15 @@ const capture = async () => {
|
||||
|
||||
await waitForLoadedImages(send)
|
||||
await sleep(action?.endsWith('-submitting') ? 80 : renderSettleMilliseconds)
|
||||
const screenshot = await send('Page.captureScreenshot', { format: 'png', fromSurface: true, captureBeyondViewport: false })
|
||||
await send('Page.bringToFront')
|
||||
const screenshot = await send('Page.captureScreenshot', { format: 'png', fromSurface: action !== 'from-view', captureBeyondViewport: false })
|
||||
fs.mkdirSync(path.dirname(output), { recursive: true })
|
||||
fs.writeFileSync(output, Buffer.from(screenshot.data, 'base64'))
|
||||
process.stdout.write(`CAPTURED ${output}\n`)
|
||||
} finally {
|
||||
try { await send('Emulation.clearDeviceMetricsOverride') } catch (_) {}
|
||||
if (action !== 'keep-view') {
|
||||
try { await send('Emulation.clearDeviceMetricsOverride') } catch (_) {}
|
||||
}
|
||||
socket.close()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user