Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update benchmark-web-vitals to allow connection to existing browser instance (e.g. on mobile device) #58

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

westonruter
Copy link
Collaborator

@westonruter westonruter commented Jul 21, 2023

This introduces a new --connect/-c option which causes puppeteer.connect() to be used instead of puppeteer.launch(). This is intended to allow benchmark-web-vitals to run on an existing browser instance, such as on a mobile device:

npm run research -- benchmark-web-vitals -u http://example.com -n 1 -p --connect 'ws://127.0.0.1:9222/devtools/browser'

Nevertheless, I've not gotten this to work yet. The process hangs at the call to puppeteer.connect() and I'm not sure why.

Here is how I set up my environment to test. (See also Remote debug Android devices.)

  1. Obtain Android phone
  2. Enable Developer Options
  3. Enable USB Debugging in Developer Options
  4. Connect phone to computer.
  5. On phone, a "Allow USB debugging?" dialog will appear. Tap Allow.
  6. If using ChromeOS, click "Connect to Linux" in the "USB device detected" dialog.
  7. On computer, make sure that adb (Android Debug Studio) is installed. (In Linux, sudo apt-get install adb.)
  8. On computer, open terminal and run: adb forward tcp:9222 localabstract:chrome_devtools_remote
  9. Open up some URL in Chrome on the device (e.g. example.net).

At this point, when you go to chrome://inspect/#devices on your computer, you should see the Android phone connected:

image

Note the Remote Target entry seems to be a mirror of the other target (here Pixel 5) which shows up once you do adb forward.

At this point as well, you should be able to tap on the inspect link for one of the Chrome tabs listed and get the DevTools opened for that tab:

image

On your computer, you should be able to un curl http://localhost:9222/json/version and get something like:

{
   "Android-Package": "com.android.chrome",
   "Browser": "Chrome/115.0.5790.136",
   "Protocol-Version": "1.3",
   "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36",
   "V8-Version": "11.5.150.16",
   "WebKit-Version": "537.36 (@85c2a5a25b8821a0e33a48fae903d4e80c8067cd)",
   "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser"
}

Take note of the webSocketDebuggerUrl. This is the value that is passed into puppeteer.connect() which is the benchmark-web-vitals command exposes in this PR as --connect/-c. Nevertheless, upon trying to run this:

npm run research -- benchmark-web-vitals -u https://example.com -n 1 -p -c 'ws://127.0.0.1:9222/devtools/browser'

Nothing happens. And it times out. Sometimes I see a new about:blank tab opened on my phone or I'll see the tab navigate to the supplied URL, but otherwise nothing happens in the terminal window. I can see that the call to puppeteer.connect() seems to hang.

What I've tried is somewhat similar to what is outlined in Connecting Puppeteer to Existing Chrome Window w/ reCAPTCHA, but it is specifically for Chrome on Windows not Chrome for Android.

@westonruter
Copy link
Collaborator Author

westonruter commented Jul 21, 2023

Here's the DEBUG output:

DEBUG='*' npm run research -- benchmark-web-vitals -u https://example.org -n 1 -p -c 'ws://127.0.0.1:9222/devtools/browser'

> wpp-research@ research /home/westonruter/repos/wpp-research
> ./cli/run.mjs "benchmark-web-vitals" "-u" "https://example.org" "-n" "1" "-p" "-c" "ws://127.0.0.1:9222/devtools/browser"

  puppeteer:protocol:SEND ► [ '{"method":"Browser.getVersion","id":1}' ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/115.0.5790.136","revision":"@85c2a5a25b8821a0e33a48fae903d4e80c8067cd","userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36","jsVersion":"11.5.150.16"}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [ '{"method":"Target.getBrowserContexts","id":2}' ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":2,"result":{"browserContextIds":[]}}' ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setDiscoverTargets","params":{"discover":true,"filter":[{"type":"tab","exclude":true},{}]},"id":3}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":4}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"14b6b79d-4728-4cf3-9e95-b9489d910d33","type":"browser","title":"","url":"","attached":true,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"36","type":"page","title":"Example Domain","url":"http://example.net/","attached":false,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"39","type":"page","title":"Example Domain","url":"https://example.com/","attached":false,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"other","title":"","url":"","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":3,"result":{}}' ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"other","title":"","url":"","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"B7CD1385C34D15284ADCC888E5CDB9C0","targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"other","title":"","url":"","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"B7CD1385C34D15284ADCC888E5CDB9C0","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":5}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"B7CD1385C34D15284ADCC888E5CDB9C0","method":"Runtime.runIfWaitingForDebugger","id":6}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"DBEECCB149F5F5D61EF037CF58BB1136","targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"DBEECCB149F5F5D61EF037CF58BB1136","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":7}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"DBEECCB149F5F5D61EF037CF58BB1136","method":"Runtime.runIfWaitingForDebugger","id":8}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":4,"result":{}}' ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.createTarget","params":{"url":"about:blank"},"id":9}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":9,"result":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480"}}' ] +0ms
Error: Failed to create a page for context (id = undefined)
Error: Failed to create a page for context (id = undefined)
    at CDPBrowser._createPageInContext (file:///home/westonruter/repos/wpp-research/node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/common/Browser.js:283:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async benchmarkURL (file:///home/westonruter/repos/wpp-research/cli/commands/benchmark-web-vitals.mjs:168:16)
    at async handler (file:///home/westonruter/repos/wpp-research/cli/commands/benchmark-web-vitals.mjs:96:41)
    at async Command.<anonymous> (file:///home/westonruter/repos/wpp-research/cli/run.mjs:62:4)
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":7,"result":{},"sessionId":"DBEECCB149F5F5D61EF037CF58BB1136"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":5,"result":{},"sessionId":"B7CD1385C34D15284ADCC888E5CDB9C0"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":6,"result":{},"sessionId":"B7CD1385C34D15284ADCC888E5CDB9C0"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":8,"result":{},"sessionId":"DBEECCB149F5F5D61EF037CF58BB1136"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms

This errored out with:

Error: Failed to create a page for context (id = undefined)

This seems to have been a one-off error, however.

@westonruter
Copy link
Collaborator Author

westonruter commented Jul 21, 2023

And another:

DEBUG='*' npm run research -- benchmark-web-vitals -u https://example.org -n 1 -p -c 'ws://127.0.0.1:9222/devtools/browser'
westonruter@penguin:~/repos/wpp-research (add/connect-existing-browser)$ 
> wpp-research@ research /home/westonruter/repos/wpp-research
> ./cli/run.mjs "benchmark-web-vitals" "-u" "https://example.org" "-n" "1" "-p" "-c" "ws://127.0.0.1:9222/devtools/browser"

  puppeteer:protocol:SEND ► [ '{"method":"Browser.getVersion","id":1}' ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/115.0.5790.136","revision":"@85c2a5a25b8821a0e33a48fae903d4e80c8067cd","userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Mobile Safari/537.36","jsVersion":"11.5.150.16"}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [ '{"method":"Target.getBrowserContexts","id":2}' ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":2,"result":{"browserContextIds":[]}}' ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setDiscoverTargets","params":{"discover":true,"filter":[{"type":"tab","exclude":true},{}]},"id":3}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":4}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"36","type":"page","title":"Example Domain","url":"http://example.net/","attached":false,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"39","type":"page","title":"Example Domain","url":"https://example.com/","attached":false,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"5A81277A7FDB01A1E7514C39F091B17E","type":"page","title":"about:blank","url":"about:blank","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"page","title":"about:blank","url":"about:blank","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"c096da2c-859d-45ff-a2cb-87bf7a2a459e","type":"browser","title":"","url":"","attached":true,"canAccessOpener":false}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":3,"result":{}}' ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"5A81277A7FDB01A1E7514C39F091B17E","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"93196968BC5FBFC9098725F1A5F52B7D","targetInfo":{"targetId":"5A81277A7FDB01A1E7514C39F091B17E","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"93196968BC5FBFC9098725F1A5F52B7D","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":5}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"93196968BC5FBFC9098725F1A5F52B7D","method":"Runtime.runIfWaitingForDebugger","id":6}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"01317A788B8E30F534442A9E190B1435","targetInfo":{"targetId":"5EC9DEA8D1639814BACF1C602C06F480","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"01317A788B8E30F534442A9E190B1435","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":7}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"01317A788B8E30F534442A9E190B1435","method":"Runtime.runIfWaitingForDebugger","id":8}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"A6A8B3D01FEE5AA6733CBC93CB93FF97","targetInfo":{"targetId":"80EA1AE971BB369FBC45F91D7FD3AAE4","type":"page","title":"Example Domain","url":"https://example.com/","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":false}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"A6A8B3D01FEE5AA6733CBC93CB93FF97","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":9}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"A6A8B3D01FEE5AA6733CBC93CB93FF97","method":"Runtime.runIfWaitingForDebugger","id":10}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [ '{"id":4,"result":{}}' ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"method":"Target.createTarget","params":{"url":"about:blank"},"id":11}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":5,"result":{},"sessionId":"93196968BC5FBFC9098725F1A5F52B7D"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"B828EC430C825F15B644C9A3F64F31E7","type":"page","title":"","url":"","attached":false,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"B828EC430C825F15B644C9A3F64F31E7","type":"page","title":"","url":"","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.attachedToTarget","params":{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","targetInfo":{"targetId":"B828EC430C825F15B644C9A3F64F31E7","type":"page","title":"","url":"","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"},"waitingForDebugger":true}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Target.setAutoAttach","params":{"waitForDebuggerOnStart":true,"flatten":true,"autoAttach":true},"id":12}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.runIfWaitingForDebugger","id":13}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":11,"result":{"targetId":"B828EC430C825F15B644C9A3F64F31E7"}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":6,"result":{},"sessionId":"93196968BC5FBFC9098725F1A5F52B7D"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":7,"result":{},"sessionId":"01317A788B8E30F534442A9E190B1435"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":8,"result":{},"sessionId":"01317A788B8E30F534442A9E190B1435"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":9,"result":{},"sessionId":"A6A8B3D01FEE5AA6733CBC93CB93FF97"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":10,"result":{},"sessionId":"A6A8B3D01FEE5AA6733CBC93CB93FF97"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"B828EC430C825F15B644C9A3F64F31E7","type":"page","title":"about:blank","url":"about:blank","attached":true,"canAccessOpener":false,"browserContextId":"BECAFE267D4752ED954EBB1D6FE3BC54"}}}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":12,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":13,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Page.enable","id":14}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Page.getFrameTree","id":15}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Performance.enable","id":16}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Log.enable","id":17}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":14,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":15,"result":{"frameTree":{"frame":{"id":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","url":"about:blank","domainAndRegistry":"","securityOrigin":"://","mimeType":"text/html","adFrameStatus":{"adFrameType":"none"},"secureContextType":"InsecureScheme","crossOriginIsolatedContextType":"NotIsolated","gatedAPIFeatures":[]}}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":16,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":17,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Page.setLifecycleEventsEnabled","params":{"enabled":true},"id":18}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.enable","id":19}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Network.enable","id":20}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"commit","timestamp":471.938661},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"DOMContentLoaded","timestamp":471.938818},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"load","timestamp":471.940863},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkAlmostIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":18,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"://","name":"","uniqueId":"1720878092991385943.-9007463024345295458","auxData":{"isDefault":true,"type":"default","frameId":"B828EC430C825F15B644C9A3F64F31E7"}}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":19,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":20,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Page.addScriptToEvaluateOnNewDocument","params":{"source":"//# sourceURL=pptr://__puppeteer_evaluation_script__","worldName":"__puppeteer_utility_world__"},"id":21}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":21,"result":{"identifier":"1"},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Page.createIsolatedWorld","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","worldName":"__puppeteer_utility_world__","grantUniveralAccess":true},"id":22}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Runtime.executionContextCreated","params":{"context":{"id":2,"origin":"","name":"__puppeteer_utility_world__","uniqueId":"9124827701045603059.5883842346785657412","auxData":{"isDefault":false,"type":"isolated","frameId":"B828EC430C825F15B644C9A3F64F31E7"}}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":22,"result":{"executionContextId":2},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Emulation.setDeviceMetricsOverride","params":{"mobile":false,"width":800,"height":600,"deviceScaleFactor":1,"screenOrientation":{"angle":0,"type":"portraitPrimary"}},"id":23}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Emulation.setTouchEmulationEnabled","params":{"enabled":false},"id":24}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.frameResized","params":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":23,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":24,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Emulation.setDeviceMetricsOverride","params":{"mobile":false,"width":960,"height":700,"deviceScaleFactor":1,"screenOrientation":{"angle":0,"type":"portraitPrimary"}},"id":25}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Emulation.setTouchEmulationEnabled","params":{"enabled":false},"id":26}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.frameResized","params":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":25,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":26,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.addBinding","params":{"name":"__ariaQuerySelector"},"id":27}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":27,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"function addPageBinding(type, name) {\\n    // This is the CDP binding.\\n    // @ts-expect-error: In a different context.\\n    const callCDP = globalThis[name];\\n    // We replace the CDP binding with a Puppeteer binding.\\n    Object.assign(globalThis, {\\n        [name](...args) {\\n            var _a, _b, _c;\\n            // This is the Puppeteer binding.\\n            // @ts-expect-error: In a different context.\\n            const callPuppeteer = globalThis[name];\\n            (_a = callPuppeteer.args) !== null && _a !== void 0 ? _a : (callPuppeteer.args = new Map());\\n            (_b = callPuppeteer.callbacks) !== null && _b !== void 0 ? _b : (callPuppeteer.callbacks = new Map());\\n            const seq = ((_c = callPuppeteer.lastSeq) !== null && _c !== void 0 ? _c : 0) + 1;\\n            callPuppeteer.lastSeq = seq;\\n            callPuppeteer.args.set(seq, args);\\n            callCDP(JSON.stringify({\\n                type,\\n                name,\\n                seq,\\n                args,\\n                isTrivial: !args.some(value => {\\n                    return value instanceof Node;\\n                }),\\n            }));\\n            return new Promise((resolve, reject) => {\\n                callPuppeteer.callbacks.set(seq, {\\n                    resolve(value) {\\n                        callPuppeteer.args.delete(seq);\\n                        resolve(value);\\n                    },\\n                    reject(value) {\\n                        callPuppeteer.args.delete(seq);\\n                        reject(value);\\n                    },\\n                });\\n            });\\n        },\\n    });\\n}\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"value":"internal"},{"value":"__ariaQuerySelector"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":28}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":28,"result":{"result":{"type":"undefined"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.addBinding","params":{"name":"__ariaQuerySelectorAll"},"id":29}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":29,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"function addPageBinding(type, name) {\\n    // This is the CDP binding.\\n    // @ts-expect-error: In a different context.\\n    const callCDP = globalThis[name];\\n    // We replace the CDP binding with a Puppeteer binding.\\n    Object.assign(globalThis, {\\n        [name](...args) {\\n            var _a, _b, _c;\\n            // This is the Puppeteer binding.\\n            // @ts-expect-error: In a different context.\\n            const callPuppeteer = globalThis[name];\\n            (_a = callPuppeteer.args) !== null && _a !== void 0 ? _a : (callPuppeteer.args = new Map());\\n            (_b = callPuppeteer.callbacks) !== null && _b !== void 0 ? _b : (callPuppeteer.callbacks = new Map());\\n            const seq = ((_c = callPuppeteer.lastSeq) !== null && _c !== void 0 ? _c : 0) + 1;\\n            callPuppeteer.lastSeq = seq;\\n            callPuppeteer.args.set(seq, args);\\n            callCDP(JSON.stringify({\\n                type,\\n                name,\\n                seq,\\n                args,\\n                isTrivial: !args.some(value => {\\n                    return value instanceof Node;\\n                }),\\n            }));\\n            return new Promise((resolve, reject) => {\\n                callPuppeteer.callbacks.set(seq, {\\n                    resolve(value) {\\n                        callPuppeteer.args.delete(seq);\\n                        resolve(value);\\n                    },\\n                    reject(value) {\\n                        callPuppeteer.args.delete(seq);\\n                        reject(value);\\n                    },\\n                });\\n            });\\n        },\\n    });\\n}\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"value":"internal"},{"value":"__ariaQuerySelectorAll"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":30}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":30,"result":{"result":{"type":"undefined"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.evaluate","params":{"expression":"(() => {\\n      const module = {};\\n      \\"use strict\\";\\nvar __defProp = Object.defineProperty;\\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\\nvar __getOwnPropNames = Object.getOwnPropertyNames;\\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\\nvar __export = (target, all) => {\\n  for (var name in all)\\n    __defProp(target, name, { get: all[name], enumerable: true });\\n};\\nvar __copyProps = (to, from, except, desc) => {\\n  if (from && typeof from === \\"object\\" || typeof from === \\"function\\") {\\n    for (let key of __getOwnPropNames(from))\\n      if (!__hasOwnProp.call(to, key) && key !== except)\\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\\n  }\\n  return to;\\n};\\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod);\\n\\n// src/injected/injected.ts\\nvar injected_exports = {};\\n__export(injected_exports, {\\n  default: () => injected_default\\n});\\nmodule.exports = __toCommonJS(injected_exports);\\n\\n// src/common/Errors.ts\\nvar CustomError = class extends Error {\\n  constructor(message) {\\n    super(message);\\n    this.name = this.constructor.name;\\n    Error.captureStackTrace(this, this.constructor);\\n  }\\n};\\nvar TimeoutError = class extends CustomError {\\n};\\nvar ProtocolError = class extends CustomError {\\n  #code;\\n  #originalMessage = \\"\\";\\n  set code(code) {\\n    this.#code = code;\\n  }\\n  get code() {\\n    return this.#code;\\n  }\\n  set originalMessage(originalMessage) {\\n    this.#originalMessage = originalMessage;\\n  }\\n  get originalMessage() {\\n    return this.#originalMessage;\\n  }\\n};\\nvar errors = Object.freeze({\\n  TimeoutError,\\n  ProtocolError\\n});\\n\\n// src/util/DeferredPromise.ts\\nfunction createDeferredPromise(opts) {\\n  let isResolved = false;\\n  let isRejected = false;\\n  let resolver;\\n  let rejector;\\n  const taskPromise = new Promise((resolve, reject) => {\\n    resolver = resolve;\\n    rejector = reject;\\n  });\\n  const timeoutId = opts && opts.timeout > 0 ? setTimeout(() => {\\n    isRejected = true;\\n    rejector(new TimeoutError(opts.message));\\n  }, opts.timeout) : void 0;\\n  return Object.assign(taskPromise, {\\n    resolved: () => {\\n      return isResolved;\\n    },\\n    finished: () => {\\n      return isResolved || isRejected;\\n    },\\n    resolve: (value) => {\\n      if (timeoutId) {\\n        clearTimeout(timeoutId);\\n      }\\n      isResolved = true;\\n      resolver(value);\\n    },\\n    reject: (err) => {\\n      clearTimeout(timeoutId);\\n      isRejected = true;\\n      rejector(err);\\n    }\\n  });\\n}\\n\\n// src/util/Function.ts\\nvar createdFunctions = /* @__PURE__ */ new Map();\\nvar createFunction = (functionValue) => {\\n  let fn = createdFunctions.get(functionValue);\\n  if (fn) {\\n    return fn;\\n  }\\n  fn = new Function(`return ${functionValue}`)();\\n  createdFunctions.set(functionValue, fn);\\n  return fn;\\n};\\n\\n// src/injected/ARIAQuerySelector.ts\\nvar ARIAQuerySelector_exports = {};\\n__export(ARIAQuerySelector_exports, {\\n  ariaQuerySelector: () => ariaQuerySelector,\\n  ariaQuerySelectorAll: () => ariaQuerySelectorAll\\n});\\nvar ariaQuerySelector = (root, selector) => {\\n  return window.__ariaQuerySelector(root, selector);\\n};\\nvar ariaQuerySelectorAll = async function* (root, selector) {\\n  yield* await window.__ariaQuerySelectorAll(root, selector);\\n};\\n\\n// src/injected/CustomQuerySelector.ts\\nvar CustomQuerySelector_exports = {};\\n__export(CustomQuerySelector_exports, {\\n  customQuerySelectors: () => customQuerySelectors\\n});\\nvar CustomQuerySelectorRegistry = class {\\n  #selectors = /* @__PURE__ */ new Map();\\n  register(name, handler) {\\n    if (!handler.queryOne && handler.queryAll) {\\n      const querySelectorAll = handler.queryAll;\\n      handler.queryOne = (node, selector) => {\\n        for (const result of querySelectorAll(node, selector)) {\\n          return result;\\n        }\\n        return null;\\n      };\\n    } else if (handler.queryOne && !handler.queryAll) {\\n      const querySelector = handler.queryOne;\\n      handler.queryAll = (node, selector) => {\\n        const result = querySelector(node, selector);\\n        return result ? [result] : [];\\n      };\\n    } else if (!handler.queryOne || !handler.queryAll) {\\n      throw new Error(\\"At least one query method must be defined.\\");\\n    }\\n    this.#selectors.set(name, {\\n      querySelector: handler.queryOne,\\n      querySelectorAll: handler.queryAll\\n    });\\n  }\\n  unregister(name) {\\n    this.#selectors.delete(name);\\n  }\\n  get(name) {\\n    return this.#selectors.get(name);\\n  }\\n  clear() {\\n    this.#selectors.clear();\\n  }\\n};\\nvar customQuerySelectors = new CustomQuerySelectorRegistry();\\n\\n// src/injected/PierceQuerySelector.ts\\nvar PierceQuerySelector_exports = {};\\n__export(PierceQuerySelector_exports, {\\n  pierceQuerySelector: () => pierceQuerySelector,\\n  pierceQuerySelectorAll: () => pierceQuerySelectorAll\\n});\\nvar pierceQuerySelector = (root, selector) => {\\n  let found = null;\\n  const search = (root2) => {\\n    const iter = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT);\\n    do {\\n      const currentNode = iter.currentNode;\\n      if (currentNode.shadowRoot) {\\n        search(currentNode.shadowRoot);\\n      }\\n      if (currentNode instanceof ShadowRoot) {\\n        continue;\\n      }\\n      if (currentNode !== root2 && !found && currentNode.matches(selector)) {\\n        found = currentNode;\\n      }\\n    } while (!found && iter.nextNode());\\n  };\\n  if (root instanceof Document) {\\n    root = root.documentElement;\\n  }\\n  search(root);\\n  return found;\\n};\\nvar pierceQuerySelectorAll = (element, selector) => {\\n  const result = [];\\n  const collect = (root) => {\\n    const iter = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\\n    do {\\n      const currentNode = iter.currentNode;\\n      if (currentNode.shadowRoot) {\\n        collect(currentNode.shadowRoot);\\n      }\\n      if (currentNode instanceof ShadowRoot) {\\n        continue;\\n      }\\n      if (currentNode !== root && currentNode.matches(selector)) {\\n        result.push(currentNode);\\n      }\\n    } while (iter.nextNode());\\n  };\\n  if (element instanceof Document) {\\n    element = element.documentElement;\\n  }\\n  collect(element);\\n  return result;\\n};\\n\\n// src/util/assert.ts\\nvar assert = (value, message) => {\\n  if (!value) {\\n    throw new Error(message);\\n  }\\n};\\n\\n// src/injected/Poller.ts\\nvar MutationPoller = class {\\n  #fn;\\n  #root;\\n  #observer;\\n  #promise;\\n  constructor(fn, root) {\\n    this.#fn = fn;\\n    this.#root = root;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#observer = new MutationObserver(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    });\\n    this.#observer.observe(this.#root, {\\n      childList: true,\\n      subtree: true,\\n      attributes: true\\n    });\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#observer) {\\n      this.#observer.disconnect();\\n      this.#observer = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar RAFPoller = class {\\n  #fn;\\n  #promise;\\n  constructor(fn) {\\n    this.#fn = fn;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    const poll = async () => {\\n      if (promise.finished()) {\\n        return;\\n      }\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        window.requestAnimationFrame(poll);\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    };\\n    window.requestAnimationFrame(poll);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\nvar IntervalPoller = class {\\n  #fn;\\n  #ms;\\n  #interval;\\n  #promise;\\n  constructor(fn, ms) {\\n    this.#fn = fn;\\n    this.#ms = ms;\\n  }\\n  async start() {\\n    const promise = this.#promise = createDeferredPromise();\\n    const result = await this.#fn();\\n    if (result) {\\n      promise.resolve(result);\\n      return;\\n    }\\n    this.#interval = setInterval(async () => {\\n      const result2 = await this.#fn();\\n      if (!result2) {\\n        return;\\n      }\\n      promise.resolve(result2);\\n      await this.stop();\\n    }, this.#ms);\\n  }\\n  async stop() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    if (!this.#promise.finished()) {\\n      this.#promise.reject(new Error(\\"Polling stopped\\"));\\n    }\\n    if (this.#interval) {\\n      clearInterval(this.#interval);\\n      this.#interval = void 0;\\n    }\\n  }\\n  result() {\\n    assert(this.#promise, \\"Polling never started.\\");\\n    return this.#promise;\\n  }\\n};\\n\\n// src/injected/TextContent.ts\\nvar TRIVIAL_VALUE_INPUT_TYPES = /* @__PURE__ */ new Set([\\"checkbox\\", \\"image\\", \\"radio\\"]);\\nvar isNonTrivialValueNode = (node) => {\\n  if (node instanceof HTMLSelectElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLTextAreaElement) {\\n    return true;\\n  }\\n  if (node instanceof HTMLInputElement && !TRIVIAL_VALUE_INPUT_TYPES.has(node.type)) {\\n    return true;\\n  }\\n  return false;\\n};\\nvar UNSUITABLE_NODE_NAMES = /* @__PURE__ */ new Set([\\"SCRIPT\\", \\"STYLE\\"]);\\nvar isSuitableNodeForTextMatching = (node) => {\\n  return !UNSUITABLE_NODE_NAMES.has(node.nodeName) && !document.head?.contains(node);\\n};\\nvar textContentCache = /* @__PURE__ */ new WeakMap();\\nvar eraseFromCache = (node) => {\\n  while (node) {\\n    textContentCache.delete(node);\\n    if (node instanceof ShadowRoot) {\\n      node = node.host;\\n    } else {\\n      node = node.parentNode;\\n    }\\n  }\\n};\\nvar observedNodes = /* @__PURE__ */ new WeakSet();\\nvar textChangeObserver = new MutationObserver((mutations) => {\\n  for (const mutation of mutations) {\\n    eraseFromCache(mutation.target);\\n  }\\n});\\nvar createTextContent = (root) => {\\n  let value = textContentCache.get(root);\\n  if (value) {\\n    return value;\\n  }\\n  value = { full: \\"\\", immediate: [] };\\n  if (!isSuitableNodeForTextMatching(root)) {\\n    return value;\\n  }\\n  let currentImmediate = \\"\\";\\n  if (isNonTrivialValueNode(root)) {\\n    value.full = root.value;\\n    value.immediate.push(root.value);\\n    root.addEventListener(\\n      \\"input\\",\\n      (event) => {\\n        eraseFromCache(event.target);\\n      },\\n      { once: true, capture: true }\\n    );\\n  } else {\\n    for (let child = root.firstChild; child; child = child.nextSibling) {\\n      if (child.nodeType === Node.TEXT_NODE) {\\n        value.full += child.nodeValue ?? \\"\\";\\n        currentImmediate += child.nodeValue ?? \\"\\";\\n        continue;\\n      }\\n      if (currentImmediate) {\\n        value.immediate.push(currentImmediate);\\n      }\\n      currentImmediate = \\"\\";\\n      if (child.nodeType === Node.ELEMENT_NODE) {\\n        value.full += createTextContent(child).full;\\n      }\\n    }\\n    if (currentImmediate) {\\n      value.immediate.push(currentImmediate);\\n    }\\n    if (root instanceof Element && root.shadowRoot) {\\n      value.full += createTextContent(root.shadowRoot).full;\\n    }\\n    if (!observedNodes.has(root)) {\\n      textChangeObserver.observe(root, {\\n        childList: true,\\n        characterData: true\\n      });\\n      observedNodes.add(root);\\n    }\\n  }\\n  textContentCache.set(root, value);\\n  return value;\\n};\\n\\n// src/injected/TextQuerySelector.ts\\nvar TextQuerySelector_exports = {};\\n__export(TextQuerySelector_exports, {\\n  textQuerySelectorAll: () => textQuerySelectorAll\\n});\\nvar textQuerySelectorAll = function* (root, selector) {\\n  let yielded = false;\\n  for (const node of root.childNodes) {\\n    if (node instanceof Element && isSuitableNodeForTextMatching(node)) {\\n      let matches;\\n      if (!node.shadowRoot) {\\n        matches = textQuerySelectorAll(node, selector);\\n      } else {\\n        matches = textQuerySelectorAll(node.shadowRoot, selector);\\n      }\\n      for (const match of matches) {\\n        yield match;\\n        yielded = true;\\n      }\\n    }\\n  }\\n  if (yielded) {\\n    return;\\n  }\\n  if (root instanceof Element && isSuitableNodeForTextMatching(root)) {\\n    const textContent = createTextContent(root);\\n    if (textContent.full.includes(selector)) {\\n      yield root;\\n    }\\n  }\\n};\\n\\n// src/injected/PQuerySelector.ts\\nvar PQuerySelector_exports = {};\\n__export(PQuerySelector_exports, {\\n  pQuerySelector: () => pQuerySelector,\\n  pQuerySelectorAll: () => pQuerySelectorAll\\n});\\n\\n// src/util/AsyncIterableUtil.ts\\nvar AsyncIterableUtil = class {\\n  static async *map(iterable, map) {\\n    for await (const value of iterable) {\\n      yield await map(value);\\n    }\\n  }\\n  static async *flatMap(iterable, map) {\\n    for await (const value of iterable) {\\n      yield* map(value);\\n    }\\n  }\\n  static async collect(iterable) {\\n    const result = [];\\n    for await (const value of iterable) {\\n      result.push(value);\\n    }\\n    return result;\\n  }\\n  static async first(iterable) {\\n    for await (const value of iterable) {\\n      return value;\\n    }\\n    return;\\n  }\\n};\\n\\n// src/util/ErrorLike.ts\\nfunction isErrorLike(obj) {\\n  return typeof obj === \\"object\\" && obj !== null && \\"name\\" in obj && \\"message\\" in obj;\\n}\\n\\n// src/injected/PSelectorParser.ts\\nvar PUPPETEER_PSEUDO_ELEMENT = /^::-p-([-a-zA-Z_]+)\\\\(/;\\nvar PSelectorParser = class {\\n  #input;\\n  #escaped = false;\\n  #quoted = false;\\n  #selectors = [[[]]];\\n  constructor(input) {\\n    this.#input = input;\\n  }\\n  get selectors() {\\n    return this.#selectors;\\n  }\\n  parse() {\\n    for (let i = 0; i < this.#input.length; ++i) {\\n      if (this.#escaped) {\\n        this.#escaped = false;\\n        continue;\\n      }\\n      switch (this.#input[i]) {\\n        case \\"\\\\\\\\\\": {\\n          this.#escaped = true;\\n          break;\\n        }\\n        case \'\\"\': {\\n          this.#quoted = !this.#quoted;\\n          break;\\n        }\\n        default: {\\n          if (this.#quoted) {\\n            break;\\n          }\\n          const remainder = this.#input.slice(i);\\n          if (remainder.startsWith(\\">>>>\\")) {\\n            this.#push(this.#input.slice(0, i));\\n            this.#input = remainder.slice(\\">>>>\\".length);\\n            this.#parseDeepChild();\\n          } else if (remainder.startsWith(\\">>>\\")) {\\n            this.#push(this.#input.slice(0, i));\\n            this.#input = remainder.slice(\\">>>\\".length);\\n            this.#parseDeepDescendent();\\n          } else {\\n            const result = PUPPETEER_PSEUDO_ELEMENT.exec(remainder);\\n            if (!result) {\\n              continue;\\n            }\\n            const [match, name] = result;\\n            this.#push(this.#input.slice(0, i));\\n            this.#input = remainder.slice(match.length);\\n            this.#push({\\n              name,\\n              value: this.#scanParameter()\\n            });\\n          }\\n        }\\n      }\\n    }\\n    this.#push(this.#input);\\n  }\\n  #push(selector) {\\n    if (typeof selector === \\"string\\") {\\n      selector = selector.trimEnd();\\n      if (selector.length === 0) {\\n        return;\\n      }\\n    }\\n    const roots = this.#selectors[this.#selectors.length - 1];\\n    roots[roots.length - 1].push(selector);\\n  }\\n  #parseDeepChild() {\\n    this.#selectors[this.#selectors.length - 1].push([]);\\n  }\\n  #parseDeepDescendent() {\\n    this.#selectors.push([[]]);\\n  }\\n  #scanParameter() {\\n    const char = this.#input[0];\\n    switch (char) {\\n      case \\"\'\\":\\n      case \'\\"\':\\n        this.#input = this.#input.slice(1);\\n        const parameter = this.#scanEscapedValueTill(char);\\n        if (!this.#input.startsWith(\\")\\")) {\\n          throw new Error(\\"Expected \')\'\\");\\n        }\\n        this.#input = this.#input.slice(1);\\n        return parameter;\\n      default:\\n        return this.#scanEscapedValueTill(\\")\\");\\n    }\\n  }\\n  #scanEscapedValueTill(end) {\\n    let string = \\"\\";\\n    for (let i = 0; i < this.#input.length; ++i) {\\n      if (this.#escaped) {\\n        this.#escaped = false;\\n        string += this.#input[i];\\n        continue;\\n      }\\n      switch (this.#input[i]) {\\n        case \\"\\\\\\\\\\": {\\n          this.#escaped = true;\\n          break;\\n        }\\n        case end: {\\n          this.#input = this.#input.slice(i + 1);\\n          return string;\\n        }\\n        default: {\\n          string += this.#input[i];\\n        }\\n      }\\n    }\\n    throw new Error(`Expected \\\\`${end}\\\\``);\\n  }\\n};\\nfunction parsePSelectors(selector) {\\n  const parser = new PSelectorParser(selector);\\n  parser.parse();\\n  return parser.selectors;\\n}\\n\\n// src/injected/util.ts\\nvar util_exports = {};\\n__export(util_exports, {\\n  checkVisibility: () => checkVisibility,\\n  deepChildren: () => deepChildren,\\n  deepDescendents: () => deepDescendents\\n});\\nvar HIDDEN_VISIBILITY_VALUES = [\\"hidden\\", \\"collapse\\"];\\nvar checkVisibility = (node, visible) => {\\n  if (!node) {\\n    return visible === false;\\n  }\\n  if (visible === void 0) {\\n    return node;\\n  }\\n  const element = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;\\n  const style = window.getComputedStyle(element);\\n  const isVisible = style && !HIDDEN_VISIBILITY_VALUES.includes(style.visibility) && !isBoundingBoxEmpty(element);\\n  return visible === isVisible ? node : false;\\n};\\nfunction isBoundingBoxEmpty(element) {\\n  const rect = element.getBoundingClientRect();\\n  return rect.width === 0 || rect.height === 0;\\n}\\nfunction* deepChildren(root) {\\n  const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\\n  let node = walker.nextNode();\\n  for (; node; node = walker.nextNode()) {\\n    yield node.shadowRoot ?? node;\\n  }\\n}\\nfunction* deepDescendents(root) {\\n  const walkers = [document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT)];\\n  let walker;\\n  while (walker = walkers.shift()) {\\n    for (let node = walker.nextNode(); node; node = walker.nextNode()) {\\n      if (!node.shadowRoot) {\\n        yield node;\\n        continue;\\n      }\\n      walkers.push(\\n        document.createTreeWalker(node.shadowRoot, NodeFilter.SHOW_ELEMENT)\\n      );\\n      yield node.shadowRoot;\\n    }\\n  }\\n}\\n\\n// src/injected/XPathQuerySelector.ts\\nvar XPathQuerySelector_exports = {};\\n__export(XPathQuerySelector_exports, {\\n  xpathQuerySelectorAll: () => xpathQuerySelectorAll\\n});\\nvar xpathQuerySelectorAll = function* (root, selector) {\\n  const doc = root.ownerDocument || document;\\n  const iterator = doc.evaluate(\\n    selector,\\n    root,\\n    null,\\n    XPathResult.ORDERED_NODE_ITERATOR_TYPE\\n  );\\n  let item;\\n  while (item = iterator.iterateNext()) {\\n    yield item;\\n  }\\n};\\n\\n// src/injected/PQuerySelector.ts\\nvar SelectorError = class extends Error {\\n  constructor(selector, message) {\\n    super(`${selector} is not a valid selector: ${message}`);\\n  }\\n};\\nvar PQueryEngine = class {\\n  #input;\\n  #deepShadowSelectors;\\n  #shadowSelectors;\\n  #selectors;\\n  #selector;\\n  elements;\\n  constructor(element, selector) {\\n    this.#input = selector.trim();\\n    if (this.#input.length === 0) {\\n      throw new SelectorError(this.#input, \\"The provided selector is empty.\\");\\n    }\\n    try {\\n      this.#deepShadowSelectors = parsePSelectors(this.#input);\\n    } catch (error) {\\n      if (!isErrorLike(error)) {\\n        throw new SelectorError(this.#input, String(error));\\n      }\\n      throw new SelectorError(this.#input, error.message);\\n    }\\n    if (this.#deepShadowSelectors.some((shadowSelectors) => {\\n      return shadowSelectors.some((selectors) => {\\n        return selectors.length === 0;\\n      });\\n    })) {\\n      throw new SelectorError(\\n        this.#input,\\n        \\"Multiple deep combinators found in sequence.\\"\\n      );\\n    }\\n    this.#shadowSelectors = this.#deepShadowSelectors.shift();\\n    this.#selectors = this.#shadowSelectors.shift();\\n    this.#selector = this.#selectors.shift();\\n    this.elements = [element];\\n  }\\n  async run() {\\n    if (typeof this.#selector === \\"string\\") {\\n      switch (this.#selector.trimStart()) {\\n        case \\":scope\\":\\n          this.#next();\\n          break;\\n        default:\\n          this.#selector = ` ${this.#selector}`;\\n          break;\\n      }\\n    }\\n    for (; this.#selector !== void 0; this.#next()) {\\n      const selector = this.#selector;\\n      const input = this.#input;\\n      this.elements = AsyncIterableUtil.flatMap(\\n        this.elements,\\n        async function* (element) {\\n          if (typeof selector === \\"string\\") {\\n            if (!element.parentElement) {\\n              yield* element.querySelectorAll(selector);\\n              return;\\n            }\\n            let index = 0;\\n            for (const child of element.parentElement.children) {\\n              ++index;\\n              if (child === element) {\\n                break;\\n              }\\n            }\\n            yield* element.parentElement.querySelectorAll(\\n              `:scope > :nth-child(${index})${selector}`\\n            );\\n            return;\\n          }\\n          switch (selector.name) {\\n            case \\"text\\":\\n              yield* textQuerySelectorAll(element, selector.value);\\n              break;\\n            case \\"xpath\\":\\n              yield* xpathQuerySelectorAll(element, selector.value);\\n              break;\\n            case \\"aria\\":\\n              yield* ariaQuerySelectorAll(element, selector.value);\\n              break;\\n            default:\\n              const querySelector = customQuerySelectors.get(selector.name);\\n              if (!querySelector) {\\n                throw new SelectorError(\\n                  input,\\n                  `Unknown selector type: ${selector.name}`\\n                );\\n              }\\n              yield* querySelector.querySelectorAll(element, selector.value);\\n          }\\n        }\\n      );\\n    }\\n  }\\n  #next() {\\n    if (this.#selectors.length === 0) {\\n      if (this.#shadowSelectors.length === 0) {\\n        if (this.#deepShadowSelectors.length === 0) {\\n          this.#selector = void 0;\\n          return;\\n        }\\n        this.elements = AsyncIterableUtil.flatMap(\\n          this.elements,\\n          function* (element) {\\n            yield* deepDescendents(element);\\n          }\\n        );\\n        this.#shadowSelectors = this.#deepShadowSelectors.shift();\\n      }\\n      this.elements = AsyncIterableUtil.flatMap(\\n        this.elements,\\n        function* (element) {\\n          yield* deepChildren(element);\\n        }\\n      );\\n      this.#selectors = this.#shadowSelectors.shift();\\n    }\\n    this.#selector = this.#selectors.shift();\\n  }\\n};\\nvar pQuerySelectorAll = async function* (root, selector) {\\n  const query = new PQueryEngine(root, selector);\\n  query.run();\\n  yield* query.elements;\\n};\\nvar pQuerySelector = async function(root, selector) {\\n  for await (const element of pQuerySelectorAll(root, selector)) {\\n    return element;\\n  }\\n  return null;\\n};\\n\\n// src/injected/injected.ts\\nvar PuppeteerUtil = Object.freeze({\\n  ...ARIAQuerySelector_exports,\\n  ...CustomQuerySelector_exports,\\n  ...PierceQuerySelector_exports,\\n  ...PQuerySelector_exports,\\n  ...TextQuerySelector_exports,\\n  ...util_exports,\\n  ...XPathQuerySelector_exports,\\n  createDeferredPromise,\\n  createFunction,\\n  createTextContent,\\n  IntervalPoller,\\n  isSuitableNodeForTextMatching,\\n  MutationPoller,\\n  RAFPoller\\n});\\nvar injected_default = PuppeteerUtil;\\n\\n      \\n      return module.exports.default;\\n    })()\\n//# sourceURL=pptr://__puppeteer_evaluation_script__","contextId":1,"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":31}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":31,"result":{"result":{"type":"object","className":"Object","description":"Object","objectId":"110883974993530715.1.1"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"({ RAFPoller, createFunction }, fn, ...args) => {\\n                        const fun = createFunction(fn);\\n                        return new RAFPoller(() => {\\n                            return fun(...args);\\n                        });\\n                    }\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"objectId":"110883974993530715.1.1"},{"value":"() => {return (window.innerWidth === 960 && window.innerHeight === 700);}"}],"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":32}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":32,"result":{"result":{"type":"object","className":"RAFPoller","description":"RAFPoller","objectId":"110883974993530715.1.2"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"poller => {\\n                poller.start();\\n            }\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"objectId":"110883974993530715.1.2"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":33}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":33,"result":{"result":{"type":"undefined"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"poller => {\\n                return poller.result();\\n            }\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"objectId":"110883974993530715.1.2"}],"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":34}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkAlmostIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms

And after 30 seconds it finishes with:

Error: Waiting failed: 30000ms exceeded
TimeoutError: Waiting failed: 30000ms exceeded
    at Timeout.<anonymous> (file:///home/westonruter/repos/wpp-research/node_modules/puppeteer/node_modules/puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:60:32)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":34,"result":{"result":{"type":"object","subtype":"error","className":"Error","description":"Error: Polling stopped\\n    at RAFPoller.stop (pptr://__puppeteer_evaluation_script__:299:28)\\n    at pptr://__puppeteer_evaluation_script__:2:34","objectId":"110883974993530715.1.3"},"exceptionDetails":{"exceptionId":1,"text":"Uncaught (in promise) Error: Polling stopped","lineNumber":299,"columnNumber":28,"scriptId":"8","stackTrace":{"callFrames":[{"functionName":"stop","scriptId":"8","url":"pptr://__puppeteer_evaluation_script__","lineNumber":298,"columnNumber":27},{"functionName":"","scriptId":"14","url":"pptr://__puppeteer_evaluation_script__","lineNumber":1,"columnNumber":33}]},"exception":{"type":"object","subtype":"error","className":"Error","description":"Error: Polling stopped\\n    at RAFPoller.stop (pptr://__puppeteer_evaluation_script__:299:28)\\n    at pptr://__puppeteer_evaluation_script__:2:34","objectId":"110883974993530715.1.4"}}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":35,"result":{"result":{"type":"undefined"}},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.releaseObject","params":{"objectId":"110883974993530715.1.2"},"id":36}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"async (poller) => {\\n                    await poller.stop();\\n                }\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"objectId":"110883974993530715.1.2"}],"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":37}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":36,"result":{},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"id":37,"error":{"code":-32000,"message":"Could not find object with given id"},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms

In this case here:

  puppeteer:protocol:SEND ► [
  puppeteer:protocol:SEND ►   '{"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"poller => {\\n                return poller.result();\\n            }\\n//# sourceURL=pptr://__puppeteer_evaluation_script__\\n","executionContextId":1,"arguments":[{"objectId":"110883974993530715.1.2"}],"returnByValue":false,"awaitPromise":true,"userGesture":true},"id":34}'
  puppeteer:protocol:SEND ► ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkAlmostIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms
  puppeteer:protocol:RECV ◀ [
  puppeteer:protocol:RECV ◀   '{"method":"Page.lifecycleEvent","params":{"frameId":"B828EC430C825F15B644C9A3F64F31E7","loaderId":"564FC5BE2844B5FD409AE3F9B04AE2D6","name":"networkIdle","timestamp":471.941338},"sessionId":"E10C836D500CFDD71A5F3E0C033A9A4F"}'
  puppeteer:protocol:RECV ◀ ] +0ms

Then it times out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant