feat: add dedicated console listener methods
Merged
SH
4d ago+353+353+012345678901234567890123456789-145-145-012345678901234567890123456789
why
- dedicated event methods let each callback receive event-specific objects, including objects with callable methods, without adding overloads to
page.on() - align console subscriptions with that API pattern
what changed
- add
page.onConsole()in TypeScript andpage.on_console()in Python - preserve
page.on("console", listener)as a deprecated wrapper - update documentation and add a changeset
test plan
- unit tests cover both APIs, event delivery, and cleanup failures
- Chrome integration test verifies matching payloads, navigation, and unsubscribe
- manually verified matching log, warning, and error events
- type checks, documentation checks, and SDK build pass