Page 1 of 1
Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 11:02 am
by salvadordf
Hi,
CEF4Delphi is now updated to CEF 3.3239.1720.g1ad5e2a.
The TChromium.DeleteCookies function has been modified to use the right cookie manager in case you use custom request contexts for your browsers.
The CEF binaries used by CEF4Delphi are these :
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 11:31 am
by salvadordf
I also added a new property GlobalCEFApp.SitePerProcess with a TRUE default value.
https://www.chromium.org/Home/chromium- ... -isolation
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 5:47 pm
by thefunkyjoint
Hi,
I just did this update, but now when i call the TChromiumWindow.LoadUrl method, nothing happens...
I updated the DLLs as well, here are my DLL dir tree :
Screen Shot 2018-01-05 at 15.47.19.jpg
What i am missing ?
Thanks
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 6:18 pm
by thefunkyjoint
After some debug, i could find where the problem is : the
Initialized var is false on my case. Why ? I'm waiting about 5 seconds after i open my app to load a page.
Code: Select all
procedure TChromium.LoadURL(const aURL : ustring);
var
TempFrame : ICefFrame;
begin
if Initialized then
begin
TempFrame := FBrowser.MainFrame;
if (TempFrame <> nil) then TempFrame.LoadUrl(aURL);
end;
end;
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 6:33 pm
by salvadordf
Hi,
Initialized is set to True when the browser triggers the TChromium.OnAfterCreated event with a valid "browser" parameter.
Before that, the application must call TChromium.CreateBrowser after the global context has been initialized.
The global context is initialized in a different thread and it might happen at any moment in the application initialization.
What's the value of GlobalCEFApp.Status when you call TChromium.CreateBrowser in your computer?
Can you enable the log and post the results ? Just add these lines before GlobalCEFApp.StartMainProcess :
Code: Select all
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_ERROR;
I'll try to replicate the error with multiple browsers created with custom request contexts and I'll let you know.
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Fri Jan 05, 2018 6:42 pm
by thefunkyjoint
salvadordf wrote: Fri Jan 05, 2018 6:33 pm
Hi,
Initialized is set to True when the browser triggers the TChromium.OnAfterCreated event with a valid "browser" parameter.
Before that, the application must call TChromium.CreateBrowser after the global context has been initialized.
The global context is initialized in a different thread and it might happen at any moment in the application initialization.
What's the value of GlobalCEFApp.Status when you call TChromium.CreateBrowser in your computer?
Can you enable the log and post the results ? Just add these lines before GlobalCEFApp.StartMainProcess :
Code: Select all
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_ERROR;
I'll try to replicate the error with multiple browsers created with custom request contexts and I'll let you know.
The strange thing is i did not change anything on my app. I just update DCEF4Delphi and DLLs. If i go back to the previous version, it works again.
CreateBrowser is returning true when i debug ; i'm attaching the log file in the reply :
Code: Select all
function TChromium.CreateBrowser(const aBrowserParent : TWinControl;
const aWindowName : string;
const aContext : ICefRequestContext;
const aCookiesPath : string;
aPersistSessionCookies : boolean) : boolean;
var
TempHandle : HWND;
TempRect : TRect;
begin
if (aBrowserParent <> nil) then
begin
TempHandle := aBrowserParent.Handle;
TempRect := aBrowserParent.ClientRect;
end
else
begin
TempHandle := 0;
TempRect := rect(0, 0, 0, 0);
end;
Result := CreateBrowser(TempHandle, TempRect, aWindowName, aContext, aCookiesPath, aPersistSessionCookies); // RETURNS TRUE
end;
The log file contains only one line :
Code: Select all
[0105/164131.914:ERROR:url_request_context_getter_impl.cc(128)] Cannot use V8 Proxy resolver in single process mode.
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Sat Jan 06, 2018 2:48 pm
by salvadordf
Hi,
The log file indicates that you are using the single process mode and that can generate unexpected problems.
The single process mode is known to have crashes and it's unsupported by the CEF3 project.
I've added a new demo to the latest CEF4Delphi version called
MDIExternalPumpBrowser that uses an external message pump.
If you were using the single process mode because you had focus problems, I recommend you to take a look at the new demo.
It can handle multiple browsers with independent request contexts and caches, and it shouldn't have the focus stealing issues.
https://www.briskbard.com/forum/viewtopic.php?f=8&t=253
Re: Update to CEF 3.3239.1720.g1ad5e2a
Posted: Mon Jan 08, 2018 11:17 am
by thefunkyjoint
Thank you for you reply.
But even commenting the singleprocess line, the same issue happens : no page is loaded and worst : when i open my app, it goes straight to Delphi's CPU Window ; this won't happen with singleprocess enabled. And actually i've been using only singleprocess := true since i migrated from DCEF3 and everything worked fine until the update. Without this option i never could use CEF4 properly, somehow it does not work for me. I'm using Delphi 2007.
I think something changed in the latest versions, because everything was running properly. I'll come back to 3.3163.1671.0 by now, but eventually i'll need to update...