Get loaded URL from CefBrowser

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Get loaded URL from CefBrowser

Postby sprabhu » Fri Nov 09, 2018 7:28 pm

Hello,

I'm loading cef in offscreen rendering mode and calling CreateBrowser multiple times with different urls. I get the unique identifier associated with the CefBrowser but is there a way to get the url corresponding to the CefBrowser? So for example - OnPaint call gives me a handle to CefBrowser and that gives me the unique identifier but how do I find the url associated with it.

I checked for documentation on CefBrowser - apidocs3/projects/(default)/CefBrowser.html and CefBrowserHost - apidocs3/projects/(default)/CefBrowserHost.html and couldnt find any relevant API.

Thank you!
sprabhu
Newbie
 
Posts: 3
Joined: Fri Nov 02, 2018 2:18 pm

Re: Get loaded URL from CefBrowser

Postby amaitland » Fri Nov 09, 2018 7:33 pm

Every browser has at least one frame (the main frame), you access the URL through the frame.

apidocs3/projects/(default)/CefFrame.html#GetURL()
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Get loaded URL from CefBrowser

Postby amaitland » Fri Nov 09, 2018 7:35 pm

You can also be notified of changes using apidocs3/projects/(default)/CefDisplayHandler.html#OnAddressChange(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,constCefString&)
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 108 guests