Skip to content

Commit

Permalink
Wait for the debugger to start on new context. This allows us catch w…
Browse files Browse the repository at this point in the history
…eb worker and service worker requests. Fixes #44
  • Loading branch information
kdzwinel committed Apr 7, 2021
1 parent 52dfbe1 commit 1554fbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ async function getSiteData(context, url, {
// new target is created we will miss some requests, API calls, etc.
const cdpClient = await page.target().createCDPSession();

// without this, we will miss the initial request for the web worker or service worker file
await cdpClient.send('Target.setAutoAttach', {autoAttach: true, waitForDebuggerOnStart: true});

const initPageTimer = createTimer();
for (let collector of collectors) {
try {
Expand Down

0 comments on commit 1554fbf

Please sign in to comment.