If you think this new command would belong better under `Page.queryTabs()` or `Browser.queryTabs()` let me know, happy to move it or change the naming.
Also in the meantime I implemented a way to register custom CDP commands in Chrome without needing chromium patches, maybe be useful to people following this thread and looking for a workaround: https://github.com/pirate/magic-cdp
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
experimental command queryTabsinstead of a separate command for querying the tabs we should add a new data structure to https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetInfo called `embedderData` where embedders such as chrome/ could provide implementation specific information (such as tab index, active or not, pinned or not, group id). TargetInfo already contains url and title. For window detection we already have https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowForTarget. This would allow different embedders to provide different data (for instance, content shell or headless shell might not have all tab features). Additionally, we should probably only populate embedderData for targets of type "tab".
The entry point to targetInfo is here https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/target_handler.cc;l=96;drc=fc44a91d176d55c9c43a89bd7eefce89d96d0472 We should use the delegate to get embedder-specific information for a target.
I would suggest we start with one feature directly requested in the attached issue, i.e., if the tab is selected in the window. With split views and multiple windows I think it is possible that multiple tab targets are selected at once within one window and across multiple windows..
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |