lino-levan / astral

A high-level puppeteer/playwright-like library for Deno
https://jsr.io/@astral/astral
MIT License
248 stars 17 forks source link

feat: Inspect CDP messages with `DEBUG` env #65

Closed marvinhagemeister closed 5 months ago

marvinhagemeister commented 5 months ago

Add a DEBUG env variable that dumps websocket messages to the console to make it easier to debug what's going on. By default it's off.

Launching: /Users/marvinh/Library/Caches/astral/121.0.6130.0/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing --remote-debugging-port=0 --no-first-run --password-store=basic --use-mock-keychain --user-data-dir=/var/folders/p4/1fpgh8gs5853pjcrl_jl4v300000gn/T/508176846bf68017 --headless=new --hide-scrollbars
--> {"id":1,"method":"Target.createTarget","params":{"url":""}}
<-- {"id":1,"result":{"targetId":"8B7092211B427E4067347EB839231A2B"}}
--> {"id":2,"method":"Target.createTarget","params":{"url":""}}
<-- {"id":2,"result":{"targetId":"241AE5ED769EEFD63CC52B8B1215E98A"}}
--> {"id":3,"method":"Browser.close"}
<-- {"id":3,"result":{}}
--> {"id":1,"method":"Browser.close"}
<-- {"id":1,"result":{}}
marvinhagemeister commented 5 months ago

On second thought, this should probably be done in celestial