Better handling of frames, constructing frame path

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Better handling of frames, constructing frame path

Postby Petr » Mon Feb 08, 2016 5:19 am

Hi,

I would like to have information about frames tree order. FE suppose page with frame
Code: Select all
MAINFRAME //TOP:0
    frame[0] //TOP:0/Frame:0
        frame[0] //TOP:0/Frame:0/Frame:0
        frame[1] //TOP:0/Frame:0/Frame:1
           frame[0] //TOP:0/Frame:0/Frame:1/Frame:0
           frame[1] //TOP:0/Frame:0/Frame:1/Frame:1
    frame[1] //TOP:0/Frame:1


Commented code show my idea how this can be done. Basically only things which have to be done is to add possibility to obtain child, left and right siblings and parent frames of frame. I was originally asking this question to dev of CefSharp, but I was told that he is not aware that this is implemented in CEF. I am using CefSharp for creation internal automation tool, and having this frame path is crucial to some pages.

Petr
Petr
Newbie
 
Posts: 2
Joined: Mon Feb 08, 2016 5:05 am

Re: Better handling of frames, constructing frame path

Postby magreenblatt » Mon Feb 08, 2016 12:11 pm

You can retrieve all frames in C++ using CefBrowser::GetFrameIdentifiers() and CefBrowser::GetFrame(). See also comments on CefFrame::GetName().
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Better handling of frames, constructing frame path

Postby Petr » Mon Feb 08, 2016 2:18 pm

I can obtain frames, but I would also like to obtain this parent child relationship? It will only when frames does not have any name or id, if it has then this info disappears. I am talking about CefSharp I am not so familiar with c++ syntax :(
Petr
Newbie
 
Posts: 2
Joined: Mon Feb 08, 2016 5:05 am

Re: Better handling of frames, constructing frame path

Postby magreenblatt » Mon Feb 08, 2016 2:41 pm

The list returned by GetFrameIdentifiers() should be ordered (e.g. siblings will be in order, parents will come before children, etc). You can then use CefFrame::GetParent to discover the hierarchy and build a string of your choice. I agree that this isn't quite as convenient as a GetNextSibling/GetChildren-style API could be.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 19 guests