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
Ability to retrieve iframe's BrowsingContext #418
Comments
The browsingContext.Info type has a context field, which is a string and matches the |
I believe the issue is that it is not possible to know from a serialized iframe element what context it currently belongs to. |
So to summarize there's no issue with |
That's right: basically the implementation for https://pptr.dev/api/puppeteer.elementhandle.contentframe/ |
So in theory one can nearly implement this in script like |
Adding |
I see. If we add such a value should we keep it in sync with the WindowProxy serialization in WebDriver classic? Probably yes. |
let me check it out |
As |
demo of what it can look like: https://crrev.com/c/4613547 |
I think this was resolved by #452 |
@whimboo and I found that the contentWindow can be null for certain types (I guess cross-origin isolated?) of iframes in Firefox. I think we overlooked this aspect when discussing this issue and perhaps we need to revisit. https://html.spec.whatwg.org/multipage/document-sequences.html#content-window |
Specifically for Firefox you can see the restrictions in-place for cross-origin iframes here: |
But that doesn't say that |
@jgraham for example https://mathiasbynens.github.io/css-dbg-stories/iframe-navigations.html (Click append iframe with a cross-origin URL). It returns null in Firefox. |
@OrKoN are you sure? We are actually talking about the |
@whimboo you are totally right. I made a mistake in a hurry :( The contentWindow is not null but it seems to be being serialized as an "object" instead of a "window" in Firefox (thus, missing the context attribute). |
After some investigation I found that this is actually a bug in our BiDi implementation in Firefox. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1867667 to get this fixed. There doesn't seem to be anything needed spec wise as of this point. |
When creating
iframe
an a Context (navigatable) is created, but there is no way get its id if you know the element, this is need for example if you need to execute a command on a specific iframe, or listen on it's events.CDP exposes 2 ways of doing this.
During the navigation event (from
about:blank
toiframe.src
) Page.frameNavigated, a propertyname
that contains the iframe's name, id or null.Using Handle and calling DOM.describeNode. Return has a
frameId
property.The text was updated successfully, but these errors were encountered: