2019-05-19 16:08:15 +02:00
|
|
|
program SimpleBrowser2;
|
2018-05-12 14:50:54 +02:00
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
uses
|
|
|
|
Interfaces, // this includes the LCL widgetset
|
2021-08-10 10:00:07 +02:00
|
|
|
Forms,
|
2018-05-12 14:50:54 +02:00
|
|
|
{ you can add units after this }
|
2021-08-10 10:00:07 +02:00
|
|
|
uCEFApplication,
|
|
|
|
uSimpleBrowser2 in 'uSimpleBrowser2.pas' {Form1};
|
2018-05-12 14:50:54 +02:00
|
|
|
|
|
|
|
{$R *.res}
|
|
|
|
|
2018-05-24 19:15:41 +02:00
|
|
|
{$IFDEF MSWINDOWS}
|
|
|
|
// CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM.
|
|
|
|
{$SetPEFlags $20}
|
|
|
|
{$ENDIF}
|
|
|
|
|
2018-05-12 14:50:54 +02:00
|
|
|
begin
|
2021-08-10 10:00:07 +02:00
|
|
|
GlobalCEFApp := TCefApplication.Create;
|
|
|
|
|
|
|
|
// In case you want to use custom directories for the CEF3 binaries, cache and user data.
|
|
|
|
// If you don't set a cache directory the browser will use in-memory cache.
|
|
|
|
{
|
|
|
|
GlobalCEFApp.FrameworkDirPath := 'c:\cef';
|
|
|
|
GlobalCEFApp.ResourcesDirPath := 'c:\cef';
|
|
|
|
GlobalCEFApp.LocalesDirPath := 'c:\cef\locales';
|
|
|
|
GlobalCEFApp.EnableGPU := True; // Enable hardware acceleration
|
|
|
|
GlobalCEFApp.cache := 'c:\cef\cache';
|
|
|
|
GlobalCEFApp.UserDataPath := 'c:\cef\User Data';
|
|
|
|
}
|
|
|
|
|
|
|
|
// You *MUST* call GlobalCEFApp.StartMainProcess in a if..then clause
|
|
|
|
// with the Application initialization inside the begin..end.
|
|
|
|
// Read this https://www.briskbard.com/index.php?lang=en&pageid=cef
|
2018-05-12 14:50:54 +02:00
|
|
|
if GlobalCEFApp.StartMainProcess then
|
|
|
|
begin
|
2019-06-19 16:53:26 +02:00
|
|
|
RequireDerivedFormResource := True;
|
2018-05-12 14:50:54 +02:00
|
|
|
Application.Initialize;
|
|
|
|
Application.CreateForm(TForm1, Form1);
|
|
|
|
Application.Run;
|
|
|
|
end;
|
|
|
|
|
2021-08-10 10:00:07 +02:00
|
|
|
GlobalCEFApp.Free;
|
|
|
|
GlobalCEFApp := nil;
|
2018-05-12 14:50:54 +02:00
|
|
|
end.
|
|
|
|
|