mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
Update to CEF 90.6.3
Enabled the ChromeRuntime mode to the TinyBrowser2 demo for Lazarus in Windows.
This commit is contained in:
parent
8188dd2ca0
commit
d24eec2794
16
README.md
16
README.md
@ -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 90.6.2 which includes Chromium 90.0.4430.93.
|
||||
CEF4Delphi uses CEF 90.6.3 which includes Chromium 90.0.4430.93.
|
||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_windows64.tar.bz2)
|
||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_linux32.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_linuxarm64.tar.bz2)
|
||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.2%2Bg5c92ffb%2Bchromium-90.0.4430.93_macosx64.tar.bz2)
|
||||
* [Windows 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_windows32.tar.bz2)
|
||||
* [Windows 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_windows64.tar.bz2)
|
||||
* [Linux x86 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_linux32.tar.bz2)
|
||||
* [Linux x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_linux64.tar.bz2)
|
||||
* [Linux ARM 32 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_linuxarm.tar.bz2)
|
||||
* [Linux ARM 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_linuxarm64.tar.bz2)
|
||||
* [MacOS x86 64 bits](https://cef-builds.spotifycdn.com/cef_binary_90.6.3%2Bgc53c523%2Bchromium-90.0.4430.93_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.
|
||||
|
||||
|
@ -37,19 +37,21 @@
|
||||
|
||||
unit uTinyBrowser2;
|
||||
|
||||
{$MODE Delphi}
|
||||
{$MODE Delphi}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Types, SysUtils,
|
||||
uCEFInterfaces, uCEFTypes, uCEFChromiumCore;
|
||||
|
||||
type
|
||||
TTinyBrowser2 = class
|
||||
private
|
||||
FChromium : TChromiumCore;
|
||||
FChromium : TChromiumCore;
|
||||
|
||||
function GetClient : ICefClient;
|
||||
|
||||
procedure Chromium_OnClose(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
procedure Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium_OnBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||
procedure Chromium_OnOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||
@ -57,7 +59,9 @@ type
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure AfterConstruction; override;
|
||||
procedure AfterConstruction; override;
|
||||
|
||||
property Client : ICefClient read GetClient;
|
||||
end;
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
@ -81,7 +85,7 @@ implementation
|
||||
// and it's necessary to close the message loop.
|
||||
|
||||
uses
|
||||
uCEFApplication;
|
||||
uCEFApplication, uCEFConstants, uCEFMiscFunctions;
|
||||
|
||||
var
|
||||
TinyBrowser : TTinyBrowser2 = nil;
|
||||
@ -89,14 +93,22 @@ var
|
||||
procedure GlobalCEFApp_OnContextInitialized;
|
||||
begin
|
||||
TinyBrowser := TTinyBrowser2.Create;
|
||||
end;
|
||||
|
||||
procedure GlobalCEFApp_OnGetDefaultClient(var aClient : ICefClient);
|
||||
begin
|
||||
aClient := TinyBrowser.Client;
|
||||
end;
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.MultiThreadedMessageLoop := False;
|
||||
GlobalCEFApp.ExternalMessagePump := False;
|
||||
GlobalCEFApp.ExternalMessagePump := False;
|
||||
GlobalCEFApp.ChromeRuntime := True; // Enable this line to enable the "ChromeRuntime" mode. It's in experimental state.
|
||||
GlobalCEFApp.cache := 'cache';
|
||||
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
|
||||
GlobalCEFApp.OnGetDefaultClient := GlobalCEFApp_OnGetDefaultClient; // This event is only used in "ChromeRuntime" mode
|
||||
|
||||
// This is a workaround for the CEF4Delphi issue #324 :
|
||||
// https://github.com/salvadordf/CEF4Delphi/issues/324
|
||||
@ -130,22 +142,29 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TTinyBrowser2.AfterConstruction;
|
||||
procedure TTinyBrowser2.AfterConstruction;
|
||||
var
|
||||
TempHandle : TCefWindowHandle;
|
||||
TempRect : TRect;
|
||||
begin
|
||||
inherited AfterConstruction;
|
||||
|
||||
FChromium := TChromiumCore.Create(nil);
|
||||
FChromium.DefaultURL := 'https://www.google.com';
|
||||
FChromium.OnClose := Chromium_OnClose;
|
||||
FChromium.OnBeforeClose := Chromium_OnBeforeClose;
|
||||
FChromium.OnBeforePopup := Chromium_OnBeforePopup;
|
||||
FChromium.OnOpenUrlFromTab := Chromium_OnOpenUrlFromTab;
|
||||
FChromium.CreateBrowser('Tiny Browser 2');
|
||||
end;
|
||||
|
||||
procedure TTinyBrowser2.Chromium_OnClose(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
InitializeWindowHandle(TempHandle);
|
||||
FChromium.CreateBrowser(TempHandle, TempRect, 'Tiny Browser 2', nil, nil, True);
|
||||
end;
|
||||
|
||||
function TTinyBrowser2.GetClient : ICefClient;
|
||||
begin
|
||||
aAction := cbaClose;
|
||||
if (FChromium <> nil) then
|
||||
Result := FChromium.CefClient
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
procedure TTinyBrowser2.Chromium_OnBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
|
@ -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="90" Minor="6" Release="2"/>
|
||||
<Version Major="90" Minor="6" Release="3"/>
|
||||
<Files Count="201">
|
||||
<Item1>
|
||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||
|
@ -66,7 +66,7 @@ uses
|
||||
const
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 90;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 6;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 2;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 3;
|
||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||
|
||||
CEF_CHROMEELF_VERSION_MAJOR = 90;
|
||||
|
@ -2,9 +2,9 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 285,
|
||||
"InternalVersion" : 286,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "90.6.2.0"
|
||||
"Version" : "90.6.3.0"
|
||||
}
|
||||
],
|
||||
"UpdatePackageData" : {
|
||||
|
Loading…
x
Reference in New Issue
Block a user