feat: WebContents.getOrCreateDevToolsTargetId()#49733
Conversation
|
@kycutler have you built and tested it? We don't allow PRs for which that's not true at the moment due to proliferation of poorly created AI PRs. |
WebContents.getDevToolsTargetId()WebContents.getOrCreateDevToolsTargetId()
Thanks for sharing additional context on the feature requested, we don't have a utility to get expected target id of a webcontent without attaching.
There was a problem hiding this comment.
Hello @kycutler! It looks like this pull request touches one of our dependency or CI files, and per our contribution policy we do not accept these types of changes in PRs.
666dc88 to
db8b64b
Compare
deepak1556
left a comment
There was a problem hiding this comment.
Implementation looks good, thanks for clarifying the use case! Still needs an api review
bbae959 to
e23dfdd
Compare
|
Release Notes Persisted
|
|
I have automatically backported this PR to "41-x-y", please check out #50176 |
Background
In VS Code we are working on a CDP implementation to manage multiple WebContentsViews. We need to implement methods like
getTargetsthat list the real targetIds of all available WebContents. Ideally we can do this synchronously and without attaching to every WebContents. But currently the only way to get the target ID of a WebContents is by attaching to it and calling e.g.Target.getTargetInfo.Description of Change
There is an existing static method
WebContents.fromDevToolsTargetId(devToolsId)that does the reverse lookup. This PR adds a method on WebContents to get the target ID directly (and synchronously).Checklist
npm testpassesRelease Notes
Notes: Added
webContents.getOrCreateDevToolsTargetId().