Skip to content

Allow debugging multiple global objects #57

@pavelfeldman

Description

@pavelfeldman

I'd like to support WebWorkers and iframes in Chromium DA.

Originally, I was going to map WebWorkers to threads in the debug adapter. But those workers run in their own isolates in v8, with their own heaps. So when I serve the evaluate request, I need to know which global object to resolve the expression against.

Adding threadId into the evaluate could solve it for workers, but there is a similar problem with the iframes. In-process iframes belong to the same v8 isolate, same heap, same thread, but they have their own v8 contexts with their own global objects. Same goes for the content scripts / worlds - that's another dimension where every frame can have multiple contexts with their own global objects.

CDP has a notion of the ExecutionContext to address that. CDP execution contexts map to the V8 contexts. There are events firing when contexts are created (for example when iframe or extension is loaded), deleted, etc. These contexts are represented in the console drop down in the Chrome's DevTools.

Is there anything similar in DAP? How should we approach implementing support for iframes & workers?

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions