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

iframes are not listed as session #1815

Open
hediet opened this issue Sep 26, 2023 · 3 comments
Open

iframes are not listed as session #1815

hediet opened this issue Sep 26, 2023 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@hediet
Copy link
Member

hediet commented Sep 26, 2023

When debugging a webpage with an iframe, iframes are not listed as session in VS Code:

Image

However, chrome lists them as sessions:

Image

Which is also convenient in the dev console:

Image

In VS Code I cannot select the iframe as my target element in the dev console. This is especially problematic when the iframe has a different origin and is inaccessible from the main window - in that case there is no way to inspect global variables of the iframe while the execution is not paused in it.

Probably #1432 is related.

demo.zip

@hediet hediet added the bug Issue identified by VS Code Team member as probable bug label Sep 26, 2023
@connor4312
Copy link
Member

connor4312 commented Oct 3, 2023

You can use the cd command to do this

image

It's not super discoverable.

I'm not actually sure why we don't have iframes be different debug sessions, but do for workers. (This was done in the prototype version of js-debug that I took over years ago.) Making them their own sessions would reduce complexity and allow a more natural target switching.

@hediet
Copy link
Member Author

hediet commented Oct 4, 2023

How can extensions send an eval request for those sessions?

Making them their own sessions would reduce complexity and allow a more natural target switching.

It would also better align with what chrome and edge does.

@connor4312
Copy link
Member

Looking more: in chrome iframes are not really separate sessions, just separate execution contexts. While some things are separate, other things are the same. For example, the state of the debugger (paused/resumed) is shared across all execution contexts, and therefore iframes. In DAP we don't have a way to represent this very well.

The fact the the CDP debugger is the same for all frames in the frame tree makes this hard to map to the current js-debug architecture which is 1:1 between CDP debuggers and debug session.

@connor4312 connor4312 added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Oct 5, 2023
@connor4312 connor4312 added this to the Backlog milestone Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants