Skip to content

Commit 1225c75

Browse files
authored
do not cache the puppeteer page internally (projectwallace#31)
fixes projectwallace#30
1 parent 0b518f0 commit 1225c75

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

_chromium.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,10 @@ async function getOptions() {
2525
}
2626
}
2727

28-
// Keep a locally cached 'page' object so that we
29-
// don't have to request the browser instance to
30-
// create a new one for each request.
31-
let _page
32-
33-
async function getPage() {
34-
if (_page) {
35-
return _page
36-
}
37-
28+
exports.extractCss = async url => {
3829
const options = await getOptions()
3930
const browser = await puppeteer.launch(options)
40-
_page = await browser.newPage() // eslint-disable-line
41-
return _page
42-
}
43-
44-
exports.extractCss = async url => {
45-
const page = await getPage()
31+
const page = await browser.newPage()
4632

4733
// Start CSS coverage. This is the meat and bones of this module
4834
await page.coverage.startCSSCoverage().catch(() => {})

0 commit comments

Comments
 (0)