ferrum icon indicating copy to clipboard operation
ferrum copied to clipboard

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

Open aarondufall opened this issue 1 year ago • 0 comments

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

aarondufall avatar Aug 03 '24 17:08 aarondufall