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

Debugger API does not expose the sessionID from which CDP messages are received #24168

Closed
3 tasks done
connor4312 opened this issue Jun 16, 2020 · 0 comments · Fixed by #24170
Closed
3 tasks done

Debugger API does not expose the sessionID from which CDP messages are received #24168

connor4312 opened this issue Jun 16, 2020 · 0 comments · Fixed by #24170

Comments

@connor4312
Copy link

connor4312 commented Jun 16, 2020

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: 8 (but same in sources)
  • Operating System: Windows 10 (1909)
  • Last Known Working Electron version: N/A

Expected Behavior

In the Debugger.message event, it is necessary to get the sessionId to be able to distinguish messages relevant to the page versus any iframes, service workers, etc. I would expect the session ID to be given in the event callback.

Actual Behavior

The debugger domain does not expose these.

Messages are emitted only with the method and params, but not the session ID

Emit("message", method, params);

In CDP these messages would normally come like:

{
  "method": "Debugger.scriptParsed",
  "params": { /* bunch o' script info */ },
  "sessionId": "8700AB9D8FEA7A760268CE9B50F369E2" // <-- we need this!
}

To Reproduce

Fiddle: https://gist.github.com/c480df80e612d06befb2d7068f0aff6e

The fiddle connect the debugger to a page with an iframe, and attaches to all targets. It logs all the arguments/data sent in the message event. Observe that the session ID is missing; there's no way to distinguish which frame the scriptParsed events are coming from.

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

Successfully merging a pull request may close this issue.

2 participants