This exposes access to any frame's url, name, parent id, and both primary and secondary execution context ids stored in Target via Page and the TargetMessage channel.
Currently this is only possible by accessing handler.targets() directly (with the exception of Frame.parent_frame which isn't exposed at all outside of CDP methods), e.g.:
// ...
tokio::spawn(async move {
loop {
tokio::select! {
res = handler.next() => {
res.unwrap();
},
req = some_channel.recv() => {
// get data from `handler.targets()`
},
}
}
});
// ...
(^ this feels a bit hacky for my liking.)
While I've included a few minor breaking changes (TargetMessage::Url, and PageInner.execution_context_for_world), these don't appear to be usable outside of the crate, so the external API should remain stable.
Please let me know if there are any changes you'd like me to make before merging, or if there's a simpler way of getting this information ;)
This exposes access to any frame's url, name, parent id, and both primary and secondary execution context ids stored in
Target
viaPage
and theTargetMessage
channel.Currently this is only possible by accessing
handler.targets()
directly (with the exception ofFrame.parent_frame
which isn't exposed at all outside of CDP methods), e.g.:(^ this feels a bit hacky for my liking.)
While I've included a few minor breaking changes (
TargetMessage::Url
, andPageInner.execution_context_for_world
), these don't appear to be usable outside of the crate, so the external API should remain stable.Please let me know if there are any changes you'd like me to make before merging, or if there's a simpler way of getting this information ;)