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.

Chromium1.CreateBrowser() takes 30 Seconds to complete

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

Re: Chromium1.CreateBrowser() takes 30 Seconds to complete

Post by salvadordf »

Where are the CEF binaries in each case?

The browser will be slower If they are located in the server.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Chromium1.CreateBrowser() takes 30 Seconds to complete

Post by salvadordf »

Please, try the suggestions available in this forum thread :
https://www.briskbard.com/forum/viewtop ... f=10&t=792
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Chromium1.CreateBrowser() takes 30 Seconds to complete

Post by salvadordf »

I forgot to add something else....

If your application has a complex initialization I would also try a different EXE for the subprocesses as shown in the "SubProcess" demo.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Chromium1.CreateBrowser() takes 30 Seconds to complete

Post by salvadordf »

TChromiumWindow is equivalent to a TCEFWindowParent with a TChromium child control.

However, I would use your existing application code and then add this line before the GlobalCEFApp.StartMainProcess call :

Code: Select all

GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe';
Then add the same GlobalCEFApp property values to SubProcess.dpr, except GlobalCEFApp.BrowserSubprocessPath

As you can see in the SubProcess demo, the CreateGlobaleCEFApp procedure is defined in uCEFLoader.pas and the calls to CreateGlobaleCEFApp and DestroyGlobaleCEFApp are made in the initialization and finalization sections of uCEFLoader.pas

Having a uCEFLoader.pas file allows you to have a much simpler DPR file in your application but this is not a requirement.

There's only one drawback if you use a different EXE for the subprocesses : Some antiviruses show a false positive in SubProcess.exe

This is a known issue with some antivirus programs that affects some applications made with Delphi. The easiest solution would be to add the SubProcess.exe to the whitelist.

I haven't tried this but some say that "stuffing" SubProcess.exe with more code or resources might give a different result with your antivirus. Some other people say that signing all the EXE and DLL files might also be a solution.
Post Reply