Parcourir la source

close the browser only when retrying the capture

Former-commit-id: 6f7625ad13627cf6af868ba684f952b994d26658
Gildas il y a 6 ans
Parent
commit
af839dddfb
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      cli/back-ends/puppeteer.js

+ 1 - 1
cli/back-ends/puppeteer.js

@@ -104,9 +104,9 @@ exports.getPageData = async options => {
 					waitUntil: options.browserWaitUntil || "networkidle0"
 				});
 				const url = page.url();
-				await browser.close();
 				if (url != options.url) {
 					options.url = url;
+					await browser.close();
 					return exports.getPageData(options);
 				} else {
 					throw error;