Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Update to CEF 3.3239.1720.g1ad5e2a

Post Reply
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Update to CEF 3.3239.1720.g1ad5e2a

Post 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 :
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post by salvadordf »

I also added a new property GlobalCEFApp.SitePerProcess with a TRUE default value.

https://www.chromium.org/Home/chromium- ... -isolation
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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
You do not have the required permissions to view the files attached to this post.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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;
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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.
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1720.g1ad5e2a

Post 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...
Post Reply