Improved memory management in NPM/puppeteer driver

main
Elbert Alias 5 years ago
parent edbc553b45
commit d18b928dc4

@ -46,9 +46,15 @@ class PuppeteerBrowser extends Browser {
} }
async visit(url) { async visit(url) {
let browser;
try { try {
const browser = await this.browser(); browser = await this.browser();
} catch (error) {
throw new Error(error.message || error.toString());
}
try {
const page = await browser.newPage(); const page = await browser.newPage();
page.setDefaultTimeout(this.options.maxWait); page.setDefaultTimeout(this.options.maxWait);
@ -116,10 +122,10 @@ class PuppeteerBrowser extends Browser {
})); }));
this.html = await page.content(); this.html = await page.content();
await page.close();
} catch (error) { } catch (error) {
throw new Error(error.toString()); throw new Error(error.message || error.toString());
} finally {
await browser.close();
} }
} }
} }

@ -2,7 +2,7 @@
"name": "wappalyzer", "name": "wappalyzer",
"description": "Uncovers the technologies used on websites", "description": "Uncovers the technologies used on websites",
"homepage": "https://github.com/AliasIO/Wappalyzer", "homepage": "https://github.com/AliasIO/Wappalyzer",
"version": "5.9.6", "version": "5.9.7",
"author": "Elbert Alias", "author": "Elbert Alias",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

Loading…
Cancel
Save