startCoverage never finish when request interception is enabled
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.18.1
- Platform / OS version: macOS Mojave 10.14.5
- URLs (if applicable):
- Node.js version: v10.15.3
What steps will reproduce the problem?
Please include code that reproduces the issue.
// run.js
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on("request", request => {
request.continue();
});
console.log("run startCoverage");
await page.coverage.startJSCoverage();
await page.coverage.startCSSCoverage();
console.log("finished startCoverage");
await page.goto("https://google.com");
console.log(await page.title());
const coverage = [
...(await page.coverage.stopJSCoverage()),
...(await page.coverage.stopCSSCoverage())
];
console.log("coverage", coverage);
await browser.close();
})();
node run.js
Above example code is pushed to the following repository: https://github.com/pirosikick/puppeteer-collect-coverage-with-request-initerception
What is the expected result? The script displays logs and outputs coverage informations the script collected.
What happens instead?
startCSSCoverage
didn’t finish.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
Request Interception - Puppeteer
Once request interception is enabled, every request will stall unless it's continued, responded or aborted. An example of a naïve request interceptor that ......
Read more >BadgerCare Plus Handbook Release 15-02
1.1.1 Organization of the BadgerCare Plus Handbook. This handbook outlines eligibility policy for Wisconsin's BadgerCare Plus program. This.
Read more >Consent Calendar Item No. 1 September Financials
NOTICE IS HEREBY GIVEN that on October 27, 2021, commencing no earlier than 11:30 a.m., via. GoToWebinar, the Governing Board of the Tahoe ......
Read more >Chapter 388-14A WAC: - WA.gov
"Agreed settlement" is an administrative order that reflects the agreement of the noncustodial parent, the custodial parent and the division of child support....
Read more >Digital Insurance Virtual Event | November 2020
Use live chat and virtual Q&As to benchmark and connect with peers to beat challenges together. You can be an active participant -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zhujun24 I was able to reproduce this. Funny enough moving
await page.setRequestInterception(true);
to below the start coverage calls gets puppeteer to successfully run.Here’s a fork of your example code that will run: https://github.com/ryhinchey/puppeteer-collect-coverage-with-request-initerception/blob/master/run.js#L16
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!