Skip to content
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

Can not access iFrames with a src attribute that has a different host. #479

Open
aarondufall opened this issue Aug 3, 2024 · 0 comments
Assignees

Comments

@aarondufall
Copy link

aarondufall commented Aug 3, 2024

Describe the bug

When the browser finds an iframe in the DOM, it publishes a Page.frameAttached event, then Ferrum takes the params and uses them to create a Frame object that adds to a collection of frames on the current Page object.
When the src URL for the iFrame contains a URL with a different host to the parent, it fires a Page.frameDetached with reason swap .
Then, a Target.targetCreated with type IFrame is published, followed by a Target.targetInfoChanged event. From what I can tell, looking at the Ferrum source code, it doesn't handle type IFrame.

In the contexts#subscribe, all the event handlers have this line, causing type IFrame to be ignored

next unless info["type"] == "page"

To Reproduce
Goto a page where the iframe src attribute has a different host to the main page.

Expected behavior
Access the iframe using the target id in the collection of Frame objects on the main Page object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants