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.

BREAKING CHANGES

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

BREAKING CHANGES

Post by salvadordf »

Hi,

This will be a fixed thread with all the breaking changes in case you are upgrading from a very old CEF4Delphi version.


TChromium.OnClose parameters changed!!!
Date : Mar 28, 2019



The latest CEF4Delphi update fixes an issue cancelling the browser destruction sequence and I had to modify the parameters in the TChromium.OnClose and TFMXChromium.OnClose events.

Before the change, TOnClose was declared like this :

Code: Select all

TOnClose = procedure(Sender: TObject; const browser: ICefBrowser; out Result: Boolean) of object;
After this update, TOnClose is declared like this :

Code: Select all

TOnClose = procedure(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction) of object;
Notice that the "out Result : boolean" parameter has been replaced by the new "var aAction : TCefCloseBrowserAction" parameter.

TCefCloseBrowserAction is defined in uCEFTypes.pas like this :

Code: Select all

TCefCloseBrowserAction = (cbaClose, cbaDelay, cbaCancel);
Each TCefCloseBrowserAction value has this meaning :
  • cbaCancel : stop closing the browser.
  • cbaClose : continue closing the browser (THIS IS THE DEFAULT VALUE IN THE ONCLOSE EVENT). This is equivalent to setting "Result" to false with the previous event parameters.
  • cbaDelay : stop closing the browser momentarily. Used when the application needs to execute some custom processes before closing the browser. This is usually needed to destroy a TCEFWindowParent in the main thread before closing the browser. This is equivalent to setting "Result" to true with the previous event parameters.
All the demos have been modified with the new OnClose code. In the case of some OSR demos the default value (cbaClose) is all they needed so the event was removed.

I'm sorry for the inconvenience. :oops:
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

Renamed units

The latest CEF4Delphi update has renamed a few units to fix the issue #119.
  • uBufferPanel.pas is now called uCEFBufferPanel.pas
  • uFMXBufferPanel.pas is now called uCEFFMXBufferPanel.pas
  • uFMXChromium.pas is now called uCEFFMXChromium.pas
  • uFMXWindowParent.pas is now called uCEFFMXWindowParent.pas
  • uFMXWorkScheduler.pas is now called uCEFFMXWorkScheduler.pas
  • uOLEDragAndDrop.pas is now called uCEFOLEDragAndDrop.pas
If you have any problems please uninstall CEF4Delphi from Delphi or Lazarus, delete all BPL and DCU files related to CEF4Delphi and install it again.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update to CEF 75.0.7 introduced many API changes and that means many procedures, functions and events may have different parameters that can break your application.

Please, read this message for all the details details :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=807
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

I just fixed an issue with the TChromiumWindow.OnBeforeClose event in this commit :
https://github.com/salvadordf/CEF4Delph ... ab743b0416

TChromiumWindow.OnBeforeClose is now executed in a different thread and the demos send a WM_CLOSE message to close the form.
If you use that event, please don't create or destroy any VCL control inside it.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update to CEF 75.1.4 changed the parameters in the TChromium.OnGetAuthCredentials event.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update made on September 25th had these breaking changes :
  • The ICEFPostData.GetCount has been renamed to ICEFPostData.GetElementCount
  • ICEFPostData.GetElements has changed. See the PostInspectorBrowser demo to know how to get all the POST elements.
  • ICefPostDataRef.AddElement and ICefPostDataRef.RemoveElement return a boolean.
Read this post for more information :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=959
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update to CEF 78.2.9 removed several properties, parameters and functions :
  • Removed GlobalCEFApp.EnableNetSecurityExpiration
  • Removed TChromium.LoadString
  • Removed TFMXChromium.LoadString
  • The "EnableNetSecurityExpiration" parameter was removed from TCefRequestContextRef.New
  • ICefResponse.GetHeader was renamed to ICefResponse.GetHeaderByName
  • Removed CefIsCertStatusMinorError
Read this for more information :
https://www.briskbard.com/forum/viewtop ... 4454#p4454
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update made on November 8th removed the TChromium.OnGetResourceRequestHandler event and replaced it with TChromium.OnGetResourceRequestHandler_ReqHdlr and TChromium.OnGetResourceRequestHandler_ReqCtxHdlr.

Read this for more info :
https://www.briskbard.com/forum/viewtop ... f=8&t=1025
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The update made on November 24th, 2019 included some changes in parameter and method names.

Read this for more information :
https://www.briskbard.com/forum/viewtop ... f=8&t=1042
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: BREAKING CHANGES

Post by salvadordf »

The commit made on March 4th, 2020 had a different way to handle usernames and password for proxies :
https://github.com/salvadordf/CEF4Delph ... c99659e51a

CEF4Delphi will use the TChromium.ProxyUsername and TChromium.ProxyPassword properties only when TChromium.ProxyType has a CEF_PROXYTYPE_FIXED_SERVERS value.

All other TChromium.ProxyType values will trigger the TChromium.OnGetAuthCredentials event. The application should ask the user for the credentials, make a copy and use it again in later requests with this code :

Code: Select all

callback.cont(username, password);
Post Reply