question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS.enable with request interceptor stops execution

See original GitHub issue

Hello. I found an error while recording coverage and tracing data. The puppeteer stops at the CDP call “CSS.enable” and cannot continue execution if the request interceptor was previously enabled.

Code to reproduce the bug:

const puppeteer = require('puppeteer');

const test = async () => {
  const browser = await puppeteer.launch({});
  const page = await browser.newPage();

  // if you remove the interceptor, the bug will not be reproduced
  await page.setRequestInterception(true);
  page.on('request', (interceptedRequest) => {
    interceptedRequest.continue();
  });

  await page.tracing.start({});
  await page.coverage.startCSSCoverage(); // <-- stayed here
  
  await page.goto('https://google.com');

  await page.coverage.stopCSSCoverage();
  await page.tracing.stop();
};

test();
  • Puppeteer version: 2.0.0
  • Platform / OS version: Windows 10 or MacOS 10.14.6
  • Node.js version: 10.15.1, 12.13.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pyatyispyatilcommented, Nov 11, 2019

Yes, this workaround works. But in my case, I want to use coverage more than once on one page.

0reactions
stale[bot]commented, Jul 27, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS.enable with request interceptor stops execution #5141
Hello. I found an error while recording coverage and tracing data. The puppeteer stops at the CDP call “CSS.enable” and cannot continue ...
Read more >
Spring MVC Interceptor HandlerInterceptorAdapter ...
The logic is really simple, I am just logging the timings of handler method execution and total time taken in processing the request...
Read more >
Intercepting JavaScript Fetch API requests and responses
We demonstrate intercepting JavaScript Fetch API calls using monkey patching and the fetch-intercept library.
Read more >
Cypress cy.intercept Problems - Gleb Bahmutov
The command cy.intercept can match requests using a substring, a minimatch, or a regular expression. By default, it intercepts requests matching ...
Read more >
Display a loader on every HTTP request using Interceptor in ...
After making a http request, some actions need navigation to a new page, the loader will stop when the http request finalize and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found