Skip to content

Commit

Permalink
Do not timeout for pages with pending partial content requests
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Sep 29, 2017
1 parent c148f9a commit a9ef212
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion decktape.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ process.on('unhandledRejection', error => {
.on('requestfailed', request => console.log(chalk`\n{keyword('orange') Unable to load resource from URL: ${request.url}}`));

console.log('Loading page', options.url, '...');
page.goto(options.url, { waitUntil: 'load', timeout: 60000 })
const load = page.waitForNavigation({ waitUntil: 'load', timeout: 20000 });
page.goto(options.url, { waitUntil: 'networkidle', timeout: 60000 })
// wait until the load event is dispatched
.then(response => load.catch(error => response.status !== 200 ? Promise.reject(error) : response))
.then(response => console.log('Loading page finished with status:', response.status))
.then(delay(options.loadPause))
.then(_ => createPlugin(page))
Expand Down

0 comments on commit a9ef212

Please sign in to comment.