Pass non-temporary frame in OnBeforeBrowse

Issue #2675 resolved
Masako Toda created an issue

I have a page with several iframes in it. When I was trying to check which frame is about to be navigated and looked at frame parameter in OnBeforeBrowse, noticed that it seemed to be a temporary frame.

Wouldn’t it be nice if frame in NavigationOnUIThread is determined by tree node id if frame id is negative? (Or is it simply wrong?)

Comments (8)

  1. Marshall Greenblatt

    Can you explain in more detail the problem that you’re trying to fix here? It may be possible to get the frame tree node ID in CefContentBrowserClient::CreateThrottlesForNavigation, but I don’t believe there will be a RenderFrameHost existing at that point, so we still wouldn’t have an existing CefFrame to retrieve for the purposes of NavigationOnUIThread.

  2. Masako Toda reporter

    In our application, we do some special thing in OnBeforeBrowse, and thought it would be nice if I knew which frame is “frame of interest”.

    At a quick glance, if I pass navigation_handle->GetFrameTreeNodeId() to NavigationOnUIThread in CefContentBrowserClient::CreateThrottlesForNavigation, source->UnsafeFindFrameByFrameTreeNodeId(tree_node_id) seems to return a valid RFH.

    “UnsafeFindFrameByFrameTreeNodeId” might not be nice to use, but thought the new frame_info_set_ might hold the sufficient information to provide the frame…?

  3. Log in to comment