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.1723.g071d1c1

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

Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

Hi,

I just uploaded the CEF4Delphi update to CEF 3.3239.1723.g071d1c1 which includes Chromium 63.0.3239.132

I also added 2 new demos :
  • MDIExternalPumpBrowser : This demo can handle multiple browsers with an external pump. This might be useful for those who have problems with MultiThreadedMessageLoop because the browser steals the focus. This demo can also create custom request contexts to have independent caches in the browsers.
  • JSWindowBindingSubProcess : This is the same than the JSSimpleWindowBinding demo but using a different EXE for the subprocesses. Read the comments in the DPR files.
I've also added some more checks and comments in the TCEFApplication initialization functions.

As of this writing, only the 32 bit CEF binaries are available but I'm sure the 64 bit version will be online soon :
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

I forgot to say that I also updated the copyright year in all files :P
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1723.g071d1c1

Post by thefunkyjoint »

Hello,

I have the same issue on this update : no page is loaded. I've uploaded a sample project on the link below :

https://wetransfer.com/downloads/fbd025 ... ient_email

It's just a simple project, with a TChromium and an Edit to type an URL. The project is already with the CEF DLLs. If you could take a look i'd very thankful, as i'm stuck on the older version.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

Hi,

There are 3 issues in the project you sent. I've decided to create a new demo called SimpleBrowser2 that uses a TChromium and a TCEFWindowParent, unlike the SimpleBrowser that uses a TChromiumWindow only.

Please download the latest CEF4Delphi version and try the SimpleBrowser2 demo. I've edited the Delphi 7 project files in that demo with notepad... I hope they work... :roll:

The issues in the project you shared were :
  • The project had a TChromium and 2 TChromiumWindow components. To create a browser you can use one TChromiumWindow like the SimpleBrowser demo, or use a combination of one TChromium and one TCEFWindowParent like the SimpleBrowser2 demo.
  • It's necessary to add some kind of delay or synchronization to call TChromium.CreateBrowser. The SimpleBrowser and SimpleBrowser2 demos use a timer.
  • The form that has the browser should handle WM_MOVE, WM_MOVING, WM_ENTERMENULOOP and WM_EXITMENULOOP.
As you can see, the SimpleBrowser2 demo sends a CEF_AFTERCREATED message to the main form to load the initial web page because the TChromium.OnAfterCreated event is called in a different thread.

The SimpleBrowser demo doesn't need this because the TChromiumWindow.OnAfterCreated event is called in the main thread.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1723.g071d1c1

Post by thefunkyjoint »

Thank you very much Salvador, with your help i could fix the issue of the new version in my app.

Your work is great ! :D
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

That's weird...

The GPU is disabled by default in CEF4Delphi to avoid problems like this.
(You can enable it manually setting GlobalCEFApp.EnabledGPU to True)

Maybe some files from the CEF binaries are missing or some overzealous antivirus moved some of the CEF files to the quarantine/vault.

This is how it should look like :
Image

Try to run the official sample application :
http://opensource.spotify.com/cefbuilds ... nt.tar.bz2

Also, make sure you are using the "RELEASE" CEF binaries and not the "DEBUG" CEF binaries.

Don't use the single process mode unless you are trying to debug your app. That mode can cause problems and it's not supported by CEF3.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3239.1723.g071d1c1

Post by thefunkyjoint »

Just to add an interesting information : i never used CEF4 with singleprocess := false. My customers don't like the app showing multiple processes in task manager, so i always use in singleprocess and it works fine. What is the problem to use singleprocess := true ?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

The CEF3 project maintainer said that the single process mode is unsupported and may have issues :
http://www.magpcss.org/ceforum/viewtopi ... =6&t=14144

Single process mode is not suitable for production use and your app could have stability problems if you use it.

If your customers don't like to see multiple processes you can also use a different EXE for the subprocesses.
Many CEF-based apps and games use this solution. The "SubProcess" demo shows how to do it with CEF4Delphi.
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: Update to CEF 3.3239.1723.g071d1c1

Post by dilfich »

Error JS
Uncaught SecurityError: Blocked a frame with origin "http://www.****.net" from accessing a frame with origin "https://www.google.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
Chromium1.Options.WebSecurity := STATE_DISABLED;
Not working anymore? Or what to enable\disable need that again everything worked.
CEF 3.3202.1686.gd665578 No problem.. :(
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3239.1723.g071d1c1

Post by salvadordf »

I'm afraid I don't know if Google changed the cross-origin policy in Chromium.

Perhaps this is a consequence of having GlobalCEFAp.SitePerProcess set to True by default.

Try setting GlobalCEFAp.SitePerProcess to False or adding GlobalCEFAp.AddCustomCommandLine('--disable-websecurity') before the GlobalCEFAp.StartMainProcess call in the DPR file.
Post Reply