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

Proposal: allow specifying documentId for devtools.inspectedWindow.eval() #393

Open
bershanskiy opened this issue May 16, 2023 · 4 comments
Labels
enhancement Enhancement or change to an existing feature supportive: chrome Supportive from Chrome supportive: firefox Supportive from Firefox topic: frame targeting

Comments

@bershanskiy
Copy link
Member

Split out form #389.

Currently, developers can execute code in a frame identified by a URL. Issue #389 notes that it might be more convenient to use frameId, especially when there are multiple frames with the exact same URL. However, in some circumstances frameId is actually inconvenient to use and documentId would be better.

For example:

  • frame can host the same document but the URL may change dynamically
  • frame can host multiple different documents and navigate between them
  • at least in Chrome, early in prerender process, document can have a non-zero frameId but then be moved to a top-level frame with frameId set to 0
@bershanskiy bershanskiy changed the title Proposal: sllow specifying documentId for devtools.inspectedWindow.eval() Proposal: sllow specifying documentId for devtools.inspectedWindow.eval() May 16, 2023
@bershanskiy bershanskiy changed the title Proposal: sllow specifying documentId for devtools.inspectedWindow.eval() Proposal: allow specifying documentId for devtools.inspectedWindow.eval() May 16, 2023
@Rob--W Rob--W added the supportive: firefox Supportive from Firefox label May 25, 2023
@Rob--W
Copy link
Member

Rob--W commented May 25, 2023

@oliverdunk Google's opinions on this (in relation to #389)?

@xeenon What's Safari's position here?

Firefox's position: sounds reasonable, if we were to implement this. The use of documentId instead of frameId would help against a TOCTOU issue that I described in #8. frameId would still be useful for cases where extensions don't know about the documentId but do know about the frameId.

@dotproto
Copy link
Member

Just opened #434 on the WebDriver BiDi repo to discuss whether it makes sense to integrate the concept of documentID in that specification.

@dotproto dotproto added topic: frame targeting enhancement Enhancement or change to an existing feature and removed needs-triage labels May 25, 2023
@oliverdunk oliverdunk added the follow-up: chrome Needs a response from a Chrome representative label May 25, 2023
@oliverdunk
Copy link
Member

@Rob--W Adding follow-up: chrome while I confirm with the team about any implementation details with this sort of thing in the DevTools API (which isn't strictly an extension API). Assuming we can support frame ID though I think it makes sense to do this too.

@oliverdunk
Copy link
Member

Having discussed this with the team, we are generally supportive. There may be some complexity around exposing these extension concepts in the implementation (which lives alongside DevTools), and this wouldn't be high priority for us, but we're open to it.

@oliverdunk oliverdunk added supportive: chrome Supportive from Chrome and removed follow-up: chrome Needs a response from a Chrome representative labels Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or change to an existing feature supportive: chrome Supportive from Chrome supportive: firefox Supportive from Firefox topic: frame targeting
Projects
None yet
Development

No branches or pull requests

4 participants