1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-02-02 10:25:26 +02:00

Update to CEF 89.0.15

Added TCefApplicationCore.LastErrorMessage property as requested in #356
This commit is contained in:
Salvador Díaz Fau 2021-03-25 13:00:37 +01:00
parent 9d61871ea1
commit 19831611d4
5 changed files with 92 additions and 86 deletions

View File

@ -3,15 +3,15 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
CEF4Delphi is based on DCEF3 and fpCEF3. The original license of those projects still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 89.0.12 which includes Chromium 89.0.4389.90.
CEF4Delphi uses CEF 89.0.15 which includes Chromium 89.0.4389.90.
The CEF binaries used by CEF4Delphi are available for download at spotify :
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.12%2Bg2b76680%2Bchromium-89.0.4389.90_macosx64.tar.bz2)
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_windows32.tar.bz2)
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_windows64.tar.bz2)
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_linux32.tar.bz2)
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_linux64.tar.bz2)
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_linuxarm.tar.bz2)
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_linuxarm64.tar.bz2)
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_89.0.15%2Bgdef70e4%2Bchromium-89.0.4389.90_macosx64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 10.4.2 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.12/FPC 3.2.0. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="5">
<Package Version="4">
<PathDelim Value="\"/>
<Name Value="CEF4Delphi_Lazarus"/>
<Type Value="RunAndDesignTime"/>
@ -21,7 +21,7 @@
</CompilerOptions>
<Description Value="CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC."/>
<License Value="MPL 1.1"/>
<Version Major="89" Release="7"/>
<Version Major="89" Release="15"/>
<Files Count="201">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
@ -846,7 +846,6 @@
<UnitName Value="uCEFOsrBrowserWindow"/>
</Item201>
</Files>
<CompatibilityMode Value="True"/>
<RequiredPkgs Count="5">
<Item1>
<PackageName Value="IDEIntf"/>

View File

@ -66,7 +66,7 @@ uses
const
CEF_SUPPORTED_VERSION_MAJOR = 89;
CEF_SUPPORTED_VERSION_MINOR = 0;
CEF_SUPPORTED_VERSION_RELEASE = 12;
CEF_SUPPORTED_VERSION_RELEASE = 15;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 89;
@ -192,6 +192,7 @@ type
FForcedDeviceScaleFactor : single;
FDisableZygote : boolean;
FUseMockKeyChain : boolean;
FLastErrorMessage : ustring;
FPluginPolicy : TCefPluginPolicySwitch;
FDefaultEncoding : ustring;
@ -550,6 +551,7 @@ type
property ApiHashPlatform : ustring read GetApiHashPlatform;
property ApiHashCommit : ustring read GetApiHashCommit;
property SupportedSchemes : TStringList read FSupportedSchemes;
property LastErrorMessage : ustring read FLastErrorMessage;
{$IFDEF LINUX}
property XDisplay : PXDisplay read GetXDisplay;
{$ENDIF}
@ -770,6 +772,8 @@ begin
FDevToolsProtocolLogFile := '';
FForcedDeviceScaleFactor := 0;
FDisableZygote := False;
FUseMockKeyChain := False;
FLastErrorMessage := '';
FDisableJavascriptCloseWindows := False;
FDisableJavascriptAccessClipboard := False;
@ -1125,7 +1129,6 @@ end;
function TCefApplicationCore.CheckCEFResources : boolean;
var
TempString : string;
TempMissingFrm, TempMissingRsc, TempMissingLoc, TempMissingSubProc : boolean;
begin
Result := False;
@ -1137,15 +1140,15 @@ begin
if TempMissingFrm or TempMissingRsc or TempMissingLoc or TempMissingSubProc then
begin
FStatus := asErrorMissingFiles;
TempString := 'CEF binaries missing !';
FStatus := asErrorMissingFiles;
FLastErrorMessage := 'CEF binaries missing !';
if (length(FMissingLibFiles) > 0) then
TempString := TempString + CRLF + CRLF +
'The missing files are :' + CRLF +
trim(FMissingLibFiles);
FLastErrorMessage := FLastErrorMessage + CRLF + CRLF +
'The missing files are :' + CRLF +
trim(FMissingLibFiles);
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end
else
Result := True;
@ -1154,7 +1157,6 @@ end;
{$IFDEF MSWINDOWS}
function TCefApplicationCore.CheckCEFDLL : boolean;
var
TempString : string;
TempMachine : integer;
TempVersionInfo : TFileVersionInfo;
begin
@ -1173,12 +1175,12 @@ begin
Result := True
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 32 bit CEF binaries with 32 bits applications only.';
FStatus := asErrorDLLVersion;
FLastErrorMessage := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 32 bit CEF binaries with 32 bits applications only.';
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end;
CEF_IMAGE_FILE_MACHINE_AMD64 :
@ -1187,23 +1189,23 @@ begin
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 64 bit CEF binaries with 64 bits applications only.';
FStatus := asErrorDLLVersion;
FLastErrorMessage := 'Wrong CEF binaries !' +
CRLF + CRLF +
'Use the 64 bit CEF binaries with 64 bits applications only.';
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end;
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unknown CEF binaries !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
FStatus := asErrorDLLVersion;
FLastErrorMessage := 'Unknown CEF binaries !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end;
end
else
@ -1212,17 +1214,17 @@ begin
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
FLastErrorMessage := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CEF4DELPHI_URL;
if GetDLLVersion(LibCefPath, TempVersionInfo) then
TempString := TempString + CRLF + CRLF +
'Expected ' + LIBCEF_DLL + ' version : ' + LibCefVersion + CRLF +
'Found ' + LIBCEF_DLL + ' version : ' + FileVersionInfoToString(TempVersionInfo);
FLastErrorMessage := FLastErrorMessage + CRLF + CRLF +
'Expected ' + LIBCEF_DLL + ' version : ' + LibCefVersion + CRLF +
'Found ' + LIBCEF_DLL + ' version : ' + FileVersionInfoToString(TempVersionInfo);
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end;
end;
{$ENDIF}
@ -2548,7 +2550,7 @@ end;
function TCefApplicationCore.LoadCEFlibrary : boolean;
var
TempOldDir, TempString : string;
TempOldDir : string;
{$IFDEF MSWINDOWS}
TempError : DWORD;
{$ENDIF}
@ -2557,10 +2559,10 @@ begin
if (FStatus <> asLoading) or FLibLoaded or (FLibHandle <> 0) then
begin
FStatus := asErrorLoadingLibrary;
TempString := 'GlobalCEFApp can only be initialized once per process.';
FStatus := asErrorLoadingLibrary;
FLastErrorMessage := 'GlobalCEFApp can only be initialized once per process.';
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
exit;
end;
@ -2585,15 +2587,15 @@ begin
FStatus := asErrorLoadingLibrary;
{$IFDEF MSWINDOWS}
TempError := GetLastError;
TempString := 'Error loading ' + LIBCEF_DLL + CRLF + CRLF +
'Error code : 0x' + inttohex(TempError, 8) + CRLF +
SysErrorMessage(TempError);
TempError := GetLastError;
FLastErrorMessage := 'Error loading ' + LIBCEF_DLL + CRLF + CRLF +
'Error code : 0x' + inttohex(TempError, 8) + CRLF +
SysErrorMessage(TempError);
{$ELSE}
TempString := 'Error loading ' + LIBCEF_DLL;
FLastErrorMessage := 'Error loading ' + LIBCEF_DLL;
{$ENDIF}
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
exit;
end;
@ -2659,13 +2661,13 @@ begin
end
else
begin
FStatus := asErrorDLLVersion;
TempString := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CRLF + CEF4DELPHI_URL;
FStatus := asErrorDLLVersion;
FLastErrorMessage := 'Unsupported CEF version !' +
CRLF + CRLF +
'Use only the CEF binaries specified in the CEF4Delphi Readme.md file at ' +
CRLF + CEF4DELPHI_URL;
ShowErrorMessageDlg(TempString);
ShowErrorMessageDlg(FLastErrorMessage);
end;
if FSetCurrentDir then chdir(TempOldDir);

View File

@ -5102,12 +5102,10 @@ begin
try
FBrowsersCS.Acquire;
if (aBrowser <> nil) and (FBrowsers <> nil) then
begin
if FBrowsers.RemoveBrowser(aBrowser) and
(FBrowserId = aBrowser.Identifier) then
FBrowserId := FBrowsers.FirstID;
end;
if (FBrowsers <> nil) and
FBrowsers.RemoveBrowser(aBrowser) and
(FBrowserId = aBrowser.Identifier) then
FBrowserId := FBrowsers.FirstID;
finally
FBrowsersCS.Release;
end;
@ -5121,8 +5119,7 @@ begin
try
FBrowsersCS.Acquire;
if (aBrowser <> nil) and
(FBrowsers <> nil) and
if (FBrowsers <> nil) and
(FMultiBrowserMode or (FBrowsers.Count = 0)) and
FBrowsers.AddBrowser(aBrowser) then
begin
@ -5184,11 +5181,11 @@ end;
function TChromiumCore.doOnClose(const browser: ICefBrowser): Boolean;
var
TempAction : TCefCloseBrowserAction;
id: Integer;
TempID : Integer;
begin
Result := False;
TempAction := cbaClose;
id := browser.Identifier;
TempID := browser.Identifier;
// TempAction values
// -----------------
@ -5207,11 +5204,11 @@ begin
cbaDelay :
begin
Result := True;
SetBrowserIsClosing(id);
SetBrowserIsClosing(TempID);
end;
else
SetBrowserIsClosing(id);
SetBrowserIsClosing(TempID);
end;
end;
@ -6868,16 +6865,20 @@ var
TempInfo : TBrowserInfo;
begin
Result := False;
i := SearchBrowser(aBrowser.Identifier);
if (i < 0) then
if (aBrowser <> nil) then
begin
TempInfo := TBrowserInfo.Create(aBrowser);
i := SearchBrowser(aBrowser.Identifier);
if (Add(TempInfo) >= 0) then
Result := True
else
TempInfo.Free;
if (i < 0) then
begin
TempInfo := TBrowserInfo.Create(aBrowser);
if (Add(TempInfo) >= 0) then
Result := True
else
TempInfo.Free;
end;
end;
end;
@ -6886,13 +6887,17 @@ var
i : integer;
begin
Result := False;
i := SearchBrowser(aBrowser.Identifier);
if (i >= 0) then
if (aBrowser <> nil) then
begin
TBrowserInfo(Items[i]).Free;
Delete(i);
Result := True;
i := SearchBrowser(aBrowser.Identifier);
if (i >= 0) then
begin
TBrowserInfo(Items[i]).Free;
Delete(i);
Result := True;
end;
end;
end;

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 271,
"InternalVersion" : 272,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "89.0.12.0"
"Version" : "89.0.15.0"
}
],
"UpdatePackageData" : {