frame->GetURL() in OnContextCreated() override is empty

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.

frame->GetURL() in OnContextCreated() override is empty

Postby user6294 » Mon Mar 19, 2018 4:20 pm

Hi,

CEF branch 3029 (May 11, 2017). Running in --single-process mode.

Scenario:

A popup window is created by a JavaScript window.open.

OnBeforePopup() override of CefLifeSpanHandler is called, frame->GetURL() returns a URL. According to the implementation OnBeforePopup() is
run on the TID_IO thread (cef_life_span_handler_capi.h).

Later on, OnContextCreated() override of CefRendererProcessHandler is called on the TID_UI thread, however frame->GetURL() returns empty string.

I saw a comment May 31 2017 version of CEF that OnBeforePopup() will changed to run on the TID_UI thread.

I don't quite understand why the URL is empty, and will this slightly later CEF version fix the issue.

Thank You
user6294
Mentor
 
Posts: 83
Joined: Sun Mar 18, 2018 6:57 pm

Re: frame->GetURL() in OnContextCreated() override is empty

Postby magreenblatt » Mon Mar 19, 2018 4:59 pm

user6294 wrote:CEF branch 3029 (May 11, 2017). Running in --single-process mode.

This CEF branch and single-process run mode are not supported. I suggest you try with a supported CEF version and supported multi-process run mode. https://bitbucket.org/chromiumembedded/ ... -supported
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: frame->GetURL() in OnContextCreated() override is empty

Postby user6294 » Mon Mar 19, 2018 5:42 pm

the normal case is without the "--single-process" command line option, I get the same results - I thought I would take the multi-process factor out of it to keep things simple so that we only have the IO thread and UI thread in the same process.
user6294
Mentor
 
Posts: 83
Joined: Sun Mar 18, 2018 6:57 pm

Re: frame->GetURL() in OnContextCreated() override is empty

Postby ivdone » Tue May 15, 2018 4:35 pm

We are having the same issue here. We are using the multi-process mode. And the url is working correctly when doing normal navigation. But when opening a link in a popup window, the frame->GetURL will return empty string in OnContextCreated()

Previously we had a workaround by storing the url when OnBeforeNavigation is called.
url = request->GetURL();

But it is now this interface is removed, we end up having the problem that we cannot get the url of the popup window in OnContextCreated.

Is this an issue with popup window or it is expected?
If it is expected, do we have any way to get the actual url in OnContextCreated for popup window?
ivdone
Newbie
 
Posts: 9
Joined: Wed May 17, 2017 12:55 pm

Re: frame->GetURL() in OnContextCreated() override is empty

Postby magreenblatt » Wed May 16, 2018 1:28 am

Please add a bug.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 33 guests