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 77.1.14

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

Update to CEF 77.1.14

Post by salvadordf »

Hi,

I just uploaded a new CEF4Delphi version to the "master" branch and deleted the "beta" branch.

I've decided to follow the same policy as other CEF wrapper projects and consider the "master" branch as the "development branch".

From now on, I will recommend using the latest CEF4Delphi release if you need a stable component.

If you decide to use the "master" branch then you will have to assume some risks due to the unresolved issues it currently has.

The list of changes since the last commit to the master branch are these :
  • Chromium 77.0.3865.120
  • New TCEFSentinel component to check the child processes when the application shuts down.
  • Added TCEFSentinel to most of the demos.
  • Fixed the CustomResourceHandler demo.
  • Added the TChromium.OnRequestContextInitialized event.
  • Added the TChromium.OnBeforePluginLoad event.
  • Added the TChromium.ReqContextHandler property.
  • Removed the GlobalCEFApp.ShutdownWaitTime property because TCEFSentinel is a much better workaround for shutdown issues.
  • Added the TChromium.PrintingEnabled property.
  • Added the TChromium.ClearCertificateExceptions function.
  • Added the TChromium.ClearHttpAuthCredentials function.
  • Added the TChromium.CloseAllConnections function.
  • Added the TChromium.OnCertificateExceptionsCleared event.
  • Added the TChromium.OnHttpAuthCredentialsCleared event.
  • Added the TChromium.OnAllConnectionsClosed event.
  • Added the TChromium.SafeSearch property.
  • Added the TChromium.YouTubeRestrict property.
  • Removed all the code to disable the Network Service from the demos because it's always enabled in CEF 77.
ATTENTION : There is a known shutdown issue with this CEF4Delphi version. Read this for more details.
https://github.com/salvadordf/CEF4Delphi/issues/230

Use the latest CEF4Delphi release to avoid the shutdown issue :
https://github.com/salvadordf/CEF4Delph ... 0.3770.100

The CEF binaries are these : Edit : I just updated the web page with the CEF4Delphi information and now it describes many more GlobalCEFApp and TChromium properties.
https://www.briskbard.com/index.php?lang=en&pageid=cef
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: Update to CEF 77.1.14

Post by dilfich »

uSimpleOSRBrowser - when resizing, the application closes. (chrmosr.WasResized;)

Does not work if you specify a resource ((

Code: Select all

chrmosr.Browser.MainFrame.LoadString('<b>test</b>', 'https://www.briskbard.com/');
So like there is no problems, why with resource stopped work
chrmosr.Browser.MainFrame.LoadString('<b>test</b>', 'about:blank');

upd.
That's how it works now...

Code: Select all

LoadString('<b>test</b>', '//www.briskbard.com/');
But still incorrect, in "str" ( <script src="//www. ) links confused as file://. :?
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.14

Post by salvadordf »

dilfich wrote: Tue Oct 15, 2019 12:13 pm uSimpleOSRBrowser - when resizing, the application closes. (chrmosr.WasResized;)
That's a known issue. Read this for more information :
https://github.com/salvadordf/CEF4Delphi/issues/214
dilfich wrote: Tue Oct 15, 2019 12:13 pm Does not work if you specify a resource ((

Code: Select all

chrmosr.Browser.MainFrame.LoadString('<b>test</b>', 'https://www.briskbard.com/');
So like there is no problems, why with resource stopped work
chrmosr.Browser.MainFrame.LoadString('<b>test</b>', 'about:blank');

upd.
That's how it works now...

Code: Select all

LoadString('<b>test</b>', '//www.briskbard.com/');
But still incorrect, in "str" ( <script src="//www. ) links confused as file://. :?
TChromium.LoadString is problematic and it usually only works if there is a render process.

In fact, the CEF project maintainer has removed that function in the next CEF branch :
https://bitbucket.org/chromiumembedded/ ... e4b640c9ef

It's recommended to use LoadURL with a "data" URL instead. The MiniBrowser demo shows how to create a "data" URL.
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: Update to CEF 77.1.14

Post by dilfich »

salvadordf wrote: Tue Oct 15, 2019 4:18 pm That's a known issue. Read this for more information :
https://github.com/salvadordf/CEF4Delphi/issues/214
I did not notice such a problem with 76, at least not so obvious.
salvadordf wrote: Tue Oct 15, 2019 4:18 pm TChromium.LoadString is problematic and it usually only works if there is a render process.

In fact, the CEF project maintainer has removed that function in the next CEF branch :
https://bitbucket.org/chromiumembedded/ ... e4b640c9ef

It's recommended to use LoadURL with a "data" URL instead. The MiniBrowser demo shows how to create a "data" URL.
I don't quite know what to do now.
Let me explain what the LoadString method gave. If you specify the address then if there are scripts, they primali specified address as if working on a real site, it turns out now it is not, how now to be?
In MiniBrowser I did not find anything similar, only showing files, it is not the same. :(
For example, when loading the script, it checks the domain, and it worked! the script believed that it was loaded with the correct address. How to do it now?

If you mean

Code: Select all

LoadURL(CefGetDataURI(TempString, 'text / html'));
it doesn't fit at all. Need download not simply the text, and frame and scripts which checks domain and without instructions street address now this became not perhaps, if even and manages the if worded in scripts is specified not explicitly the nor what vseravno not works.
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: Update to CEF 77.1.14

Post by dilfich »

A more understandable example.

Here's how it always worked, from the CeF3 to 76 versions.

Code: Select all

 LoadStr:=
 '<script src="//www.google.com/recaptcha/api.js"></script>'+
 '<div class="g-recaptcha" data-sitekey="6LcG2b0UAAAAAHty0tJihymj6CHlpmJuukpOjuNH"></div>';

Chromium1.Browser.MainFrame.LoadString(LoadStr, 'https://LoadString.com/');

Here's how it works, but this is not correct since it is not always possible to specify the correct Scheme.

Code: Select all

 LoadStr:=
 '<script src="https://www.google.com/recaptcha/api.js"></script>'+
 '<div class="g-recaptcha" data-sitekey="6LcG2b0UAAAAAHty0tJihymj6CHlpmJuukpOjuNH"></div>';

Chromium1.Browser.MainFrame.LoadString(LoadStr, '//LoadString.com/');
As you can see, the LoadString function works, but for some reason does not support http\https Protocol, only file.
I would be grateful if you show an alternative to such a download.
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.14

Post by salvadordf »

If you need to load external resources and show custom content then register an scheme.

Use the SchemeRegistrationBrowser demo as a template for your application and read this for more information about the resource handlers :
https://magpcss.org/ceforum/apidocs3/pr ... ndler.html

That demo registers the "hello" scheme but it has some limitations. Register "http" or "https" instead.
dilfich
Posts: 368
Joined: Thu Nov 30, 2017 1:17 am

Re: Update to CEF 77.1.14

Post by dilfich »

Do you really not understand the difference? And here in General files, so does not work. In place of two lines of code to write 200, a cool solution to the problem.
I just don't understand why they took it away, what caused it, what they thought was better.
New versions are just a pain, bugs + cutting functionality. :(
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.14

Post by salvadordf »

Please, remember that I'm just an independent developer. I don't work for Google or any other corporation.

Keep in mind that CEF4Delphi is a wrapper for the CEF API, which includes Chromium.
Image

The CEF project maintainer can only adapt the code in his project to the code changes in Chromium.
Then the CEF wrappers have to adapt their code to the CEF API changes.

Any change or bug in Chromium has cascading effects in CEF, then in the CEF wrappers and then in the applications using those wrappers.

Many of the changes that we have seen in the last months are a result of the new "Network Service", which is part of the changes described in this document :
https://www.chromium.org/servicification

If you search "LoadString" in this forum or the official CEF project forum you will see that it had many problems. Read this CEF issue :
https://bitbucket.org/chromiumembedded/ ... g-renderer

Registering an scheme is not a simple solution but it's the best thing we have to avoid these problems and other limitations imposed by Chromium for security reasons. It's also the solution for some problems using LoadURL with a FILE:// URL
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 77.1.14

Post by thefunkyjoint »

salvadordf wrote: Wed Oct 16, 2019 9:33 am Please, remember that I'm just an independent developer. I don't work for Google or any other corporation.

Keep in mind that CEF4Delphi is a wrapper for the CEF API, which includes Chromium.
You make an awesome work Salvador, and we all thank you for that :D

It seems CEF API is going to a lot of changes and it's pretty buggy on the recent updates. Until about three months ago my app was stable as rock, but now it crashes often and i'm sure it's CEF related...

Let's hope for improvements in the future versions.
dian
Posts: 21
Joined: Thu Aug 29, 2019 8:42 am

Re: Update to CEF 77.1.14

Post by dian »

We've just updated 76.1.13 -> 77.1.14
And most of our http requests stopped working with net::ERR_TUNNEL_CONNECTION_FAILED
Our source is competely same as for 76.1.13
What did we missed?
Post Reply