Skip to content

Interact with cross-origin iframe #280

@timwoocker

Description

@timwoocker

When loading a page which has an iframe with a different origin, page.frames() either doesn't return the frames at all or the url Option is None (idk why it behaved differently sometimes).
Either way, the only way to access a frame's content is by using GetTargetParams which successfully returns the targets of all frames. Unfortunately - since frames are not "pages", I can't use browser.get_page().
The only way I see to interact with a frame is using AttachToTargetParams which returns a SessionId. However, I don't see a way to use the SessionId other than creating command from raw json.

Is there a nice way to achieve this already?
If not - I feel like a utility method which creates a Session or Target or Frame object which shares some functionality with the Page struct would be a nice addition. Any thoughts on that?
An even simpler alternative would be something like a browser.execute_with_session() function where a SessionId can be passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:featureA request, idea or new functionalitykind:questionUnclear usage of the librarytag:help wantedExternal contributions are welcometopic:interfaceRelated to the interface exposed to the user

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions