fix(cdp): emit runtime console and exception events - #719
Open
lisa0314 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Runtime.consoleAPICalledevents while preserving argument boundaries as CDPRemoteObjectvalues.Runtime.exceptionThrownfor uncaught classic-script compilation and execution errors with URL, location, stack trace, context, and timestamp details.Runtime.enableper attached session, implementRuntime.disable, clean up detached subscriptions, bound the event queue, and skip console object retention when no Runtime subscriber exists.Fixes #677
Validation
cargo nextest run --release --features render -p obscura-cdp --test runtime_console_events: 2 passed.cargo nextest run --release --no-default-features -p obscura-cdp --test runtime_console_events: 2 passed.cargo nextest run --release --features render -p obscura-cdp: 158 passed, 3 skipped.cargo nextest run --release --features render -p obscura-js -p obscura-browser: 470 passed.--features renderand with--no-default-features.Log.entryAddedevents while retaining the expected page marker.observer-intersectionexpectedio:50and received an empty result; all other stages passed.git diff --checkpassed.Rendering
Not applicable. This does not change layout, paint, screenshots, screencasting, or PDF output.
Performance
Console
RemoteObjectserialization and object retention only run while at least one session has enabled the Runtime domain. The native page queue is capped at 1024 events with constant-time eviction.Checklist