mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
4b0b81fd9b
This patch: - Changes network idle promise to wait for 2 or fewer network requests for at least idleTime (defaults to 5s) before resolving. - Adds timer cleanup to failure navigation case. - Adds handling of webSocketClosed. - Ignores unrecognized requestIds to avoid negative inflight requests. References #10
20 lines
389 B
HTML
20 lines
389 B
HTML
<script>
|
|
async function sleep(delay) {
|
|
return new Promise(resolve => setTimeout(resolve, delay));
|
|
}
|
|
|
|
async function main() {
|
|
const roundOne = Promise.all([
|
|
fetch('fetch-request-a.js'),
|
|
fetch('fetch-request-b.js'),
|
|
fetch('fetch-request-c.js'),
|
|
]);
|
|
|
|
await roundOne;
|
|
await sleep(50);
|
|
await fetch('fetch-request-d.js');
|
|
}
|
|
|
|
main();
|
|
</script>
|