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

Update to CEF 75.0.8

- Restored the GlobalCEFApp.DeleteCookies property
- Fixed the issue with the arrow keys in OSR demos
- Fixed the default return values for TCustomCookieAccessFilter.CanSendCookie and TCustomCookieAccessFilter.CandSaveCookie
- TCustomResourceRequestHandler and TCustomCookieAccessFilterwill only be created if needed by the TChromium events.
This commit is contained in:
Salvador Díaz Fau 2019-06-19 16:53:26 +02:00
parent 52fca97884
commit 90aeb5e525
84 changed files with 887 additions and 508 deletions

View File

@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador D
CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file.
CEF4Delphi uses CEF 75.0.7 which includes Chromium 75.0.3770.80.
CEF4Delphi uses CEF 75.0.8 which includes Chromium 75.0.3770.80.
The CEF binaries used by CEF4Delphi are available for download at spotify :
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_75.0.7%2Bg19229b6%2Bchromium-75.0.3770.80_windows32.tar.bz2)
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_75.0.7%2Bg19229b6%2Bchromium-75.0.3770.80_windows64.tar.bz2)
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_75.0.8%2Bg5da93a1%2Bchromium-75.0.3770.80_windows32.tar.bz2)
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_75.0.8%2Bg5da93a1%2Bchromium-75.0.3770.80_windows64.tar.bz2)
CEF4Delphi was developed and tested on Delphi 10.3 Rio and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.2/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.

View File

@ -319,6 +319,8 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
end;
end;

View File

@ -219,7 +219,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam = VK_TAB);
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end;
WM_KEYUP :

View File

@ -56,14 +56,19 @@ uses
const
MINIBROWSER_VISITDOM_PARTIAL = WM_APP + $101;
MINIBROWSER_VISITDOM_FULL = WM_APP + $102;
MINIBROWSER_COPYFRAMEIDS_1 = WM_APP + $103;
MINIBROWSER_COPYFRAMEIDS_2 = WM_APP + $104;
MINIBROWSER_CONTEXTMENU_VISITDOM_PARTIAL = MENU_ID_USER_FIRST + 1;
MINIBROWSER_CONTEXTMENU_VISITDOM_FULL = MENU_ID_USER_FIRST + 2;
MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_1 = MENU_ID_USER_FIRST + 3;
MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_2 = MENU_ID_USER_FIRST + 4;
DOMVISITOR_MSGNAME_PARTIAL = 'domvisitorpartial';
DOMVISITOR_MSGNAME_FULL = 'domvisitorfull';
RETRIEVEDOM_MSGNAME_PARTIAL = 'retrievedompartial';
RETRIEVEDOM_MSGNAME_FULL = 'retrievedomfull';
FRAMEIDS_MSGNAME = 'getframeids';
type
TDOMVisitorFrm = class(TForm)
@ -117,6 +122,8 @@ type
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
procedure VisitDOMMsg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_PARTIAL;
procedure VisitDOM2Msg(var aMessage : TMessage); message MINIBROWSER_VISITDOM_FULL;
procedure CopyFrameIDs1(var aMessage : TMessage); message MINIBROWSER_COPYFRAMEIDS_1;
procedure CopyFrameIDs2(var aMessage : TMessage); message MINIBROWSER_COPYFRAMEIDS_2;
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
@ -257,6 +264,33 @@ begin
frame.SendProcessMessage(PID_BROWSER, msg);
end;
procedure DOMVisitor_GetFrameIDs(const browser: ICefBrowser; const frame : ICefFrame);
var
i : NativeUInt;
TempCount : NativeUInt;
TempArray : TCefFrameIdentifierArray;
TempString : string;
TempMsg : ICefProcessMessage;
begin
TempCount := browser.FrameCount;
if browser.GetFrameIdentifiers(TempCount, TempArray) then
begin
TempString := '';
i := 0;
while (i < TempCount) do
begin
TempString := TempString + inttostr(TempArray[i]) + CRLF;
inc(i);
end;
TempMsg := TCefProcessMessageRef.New(FRAMEIDS_MSGNAME);
TempMsg.ArgumentList.SetString(0, TempString);
frame.SendProcessMessage(PID_BROWSER, TempMsg);
end;
end;
procedure GlobalCEFApp_OnProcessMessageReceived(const browser : ICefBrowser;
const frame : ICefFrame;
sourceProcess : TCefProcessId;
@ -294,7 +328,13 @@ begin
end;
aHandled := True;
end;
end
else
if (message.name = FRAMEIDS_MSGNAME) then
begin
DOMVisitor_GetFrameIDs(browser, frame);
aHandled := True;
end;
end;
end;
@ -303,6 +343,7 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.RemoteDebuggingPort := 9000;
GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
GlobalCEFApp.DisableFeatures := 'NetworkService';
// Enabling the debug log file for then DOM visitor demo.
// This adds lots of warnings to the console, specially if you run this inside VirtualBox.
@ -329,6 +370,8 @@ procedure TDOMVisitorFrm.Chromium1BeforeContextMenu(Sender: TObject;
begin
model.AddItem(MINIBROWSER_CONTEXTMENU_VISITDOM_PARTIAL, 'Visit DOM in CEF (only Title)');
model.AddItem(MINIBROWSER_CONTEXTMENU_VISITDOM_FULL, 'Visit DOM in CEF (BODY HTML)');
model.AddItem(MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_1, 'Copy frame IDs in the browser process');
model.AddItem(MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_2, 'Copy frame IDs in the render process');
end;
procedure TDOMVisitorFrm.Chromium1BeforePopup(Sender: TObject;
@ -365,6 +408,12 @@ begin
MINIBROWSER_CONTEXTMENU_VISITDOM_FULL :
PostMessage(Handle, MINIBROWSER_VISITDOM_FULL, 0, 0);
MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_1 :
PostMessage(Handle, MINIBROWSER_COPYFRAMEIDS_1, 0, 0);
MINIBROWSER_CONTEXTMENU_COPYFRAMEIDS_2 :
PostMessage(Handle, MINIBROWSER_COPYFRAMEIDS_2, 0, 0);
end;
end;
@ -389,7 +438,14 @@ begin
Clipboard.AsText := message.ArgumentList.GetString(0);
ShowStatusText('HTML copied to the clipboard');
Result := True;
end;
end
else
if (message.Name = FRAMEIDS_MSGNAME) then
begin
Clipboard.AsText := message.ArgumentList.GetString(0);
ShowStatusText('Frame IDs copied to the clipboard in the render process.');
Result := True;
end;
end;
procedure TDOMVisitorFrm.FormCloseQuery(Sender: TObject;
@ -458,6 +514,39 @@ begin
Chromium1.SendProcessMessage(PID_RENDERER, TempMsg);
end;
procedure TDOMVisitorFrm.CopyFrameIDs1(var aMessage : TMessage);
var
i : NativeUInt;
TempCount : NativeUInt;
TempArray : TCefFrameIdentifierArray;
TempString : string;
begin
TempCount := Chromium1.FrameCount;
if Chromium1.GetFrameIdentifiers(TempCount, TempArray) then
begin
TempString := '';
i := 0;
while (i < TempCount) do
begin
TempString := TempString + inttostr(TempArray[i]) + CRLF;
inc(i);
end;
clipboard.AsText := TempString;
ShowStatusText('Frame IDs copied to the clipboard in the browser process (' + inttostr(TempCount) + ')');
end;
end;
procedure TDOMVisitorFrm.CopyFrameIDs2(var aMessage : TMessage);
var
TempMsg : ICefProcessMessage;
begin
TempMsg := TCefProcessMessageRef.New(FRAMEIDS_MSGNAME);
Chromium1.SendProcessMessage(PID_RENDERER, TempMsg);
end;
procedure TDOMVisitorFrm.WMMove(var aMessage : TWMMove);
begin
inherited;

View File

@ -250,7 +250,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam = VK_TAB);
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end;
WM_KEYUP :

View File

@ -286,9 +286,9 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnAfterCreated = Chromium1AfterCreated
OnBeforeClose = Chromium1BeforeClose
OnClose = Chromium1Close
OnCertificateError = Chromium1CertificateError
OnBeforeResourceLoad = Chromium1BeforeResourceLoad
OnResourceResponse = Chromium1ResourceResponse
OnCertificateError = Chromium1CertificateError
Left = 32
Top = 224
end

View File

@ -257,7 +257,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam = VK_TAB);
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end;
WM_KEYUP :

View File

@ -192,7 +192,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
Chromium1.SendKeyEvent(@TempKeyEvent);
Handled := True;
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end
else
Handled := False;

View File

@ -79,6 +79,7 @@ type
procedure Panel1Exit(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure Panel1Click(Sender: TObject);
procedure Panel1PaintParentBkg(Sender: TObject);
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
@ -108,10 +109,10 @@ type
procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
procedure SnapshotBtnClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure SnapshotBtnEnter(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure ComboBox1Enter(Sender: TObject);
procedure Panel1PaintParentBkg(Sender: TObject);
protected
FPopUpBitmap : TBitmap;
@ -256,7 +257,7 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
Handled := (Msg.wParam = VK_TAB);
Handled := (Msg.wParam in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]);
end;
WM_KEYUP :

View File

@ -59,7 +59,7 @@ uses
{$ENDIF}
begin
GlobalCEFApp := TCefApplication.Create;
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -72,6 +72,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -4,13 +4,12 @@
<PathDelim Value="\"/>
<Version Value="11"/>
<BuildModes Active="Default"/>
<Units Count="3">
<Units Count="4">
<Unit0>
<Filename Value="CookieVisitor.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<TopLine Value="53"/>
<CursorPos Y="63"/>
<TopLine Value="44"/>
<CursorPos X="25" Y="74"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -21,9 +20,10 @@
<ComponentName Value="CookieVisitorFrm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="244"/>
<CursorPos X="45" Y="263"/>
<TopLine Value="124"/>
<CursorPos X="38" Y="130"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -35,14 +35,18 @@
<ComponentName Value="SimpleTextViewerFrm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<EditorIndex Value="2"/>
<TopLine Value="7"/>
<EditorIndex Value="-1"/>
<CursorPos X="8" Y="29"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit2>
<Unit3>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32object.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="395"/>
<CursorPos X="61" Y="409"/>
<UsageCount Value="10"/>
</Unit3>
</Units>
<JumpHistory Count="11" HistoryIndex="10">
<Position1>
@ -81,12 +85,12 @@
<Caret Line="58" Column="31" TopLine="36"/>
</Position9>
<Position10>
<Filename Value="uSimpleTextViewer.pas"/>
<Caret Line="31"/>
<Filename Value="uCookieVisitor.pas"/>
<Caret Line="86" Column="26" TopLine="72"/>
</Position10>
<Position11>
<Filename Value="uCookieVisitor.pas"/>
<Caret Line="86" Column="26" TopLine="72"/>
<Caret Line="125" Column="11" TopLine="115"/>
</Position11>
</JumpHistory>
<RunParams>

View File

@ -122,6 +122,8 @@ type
var
CookieVisitorFrm: TCookieVisitorFrm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -141,6 +143,12 @@ uses
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
// This function is called in the IO thread.
function CookieVisitorProc(const name, value, domain, path: ustring;
secure, httponly, hasExpires: Boolean;

View File

@ -8,7 +8,8 @@
<Unit0>
<Filename Value="CRBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="48"/>
<IsVisibleTab Value="True"/>
<TopLine Value="40"/>
<CursorPos X="10" Y="71"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
@ -20,7 +21,6 @@
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="89"/>
<CursorPos Y="106"/>

View File

@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="243"/>
<CursorPos X="11" Y="259"/>
<TopLine Value="294"/>
<CursorPos X="39" Y="305"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -61,7 +61,7 @@
<UsageCount Value="10"/>
</Unit5>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<JumpHistory Count="29" HistoryIndex="28">
<Position1>
<Filename Value="DOMVisitor.lpr"/>
</Position1>
@ -176,10 +176,6 @@
<Filename Value="DOMVisitor.lpr"/>
<Caret Line="44" Column="13" TopLine="38"/>
</Position29>
<Position30>
<Filename Value="uDOMVisitor.pas"/>
<Caret Line="130" Column="11" TopLine="290"/>
</Position30>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -301,7 +301,8 @@ procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.RemoteDebuggingPort := 9000;
GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
GlobalCEFApp.DisableFeatures := 'NetworkService';
// Enabling the debug log file for then DOM visitor demo.
// This adds lots of warnings to the console, specially if you run this inside VirtualBox.

View File

@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="174"/>
<CursorPos X="39" Y="180"/>
<TopLine Value="106"/>
<CursorPos X="41" Y="134"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>

View File

@ -130,7 +130,8 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.FlashEnabled := False;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.DisableFeatures := 'NetworkService';
GlobalCEFApp.OnScheduleMessagePumpWork := GlobalCEFApp_OnScheduleMessagePumpWork;
end;

View File

@ -57,8 +57,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin

View File

@ -9,8 +9,8 @@
<Filename Value="FullScreenBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<TopLine Value="39"/>
<CursorPos X="3" Y="61"/>
<TopLine Value="38"/>
<CursorPos X="22" Y="60"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -22,15 +22,15 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<EditorIndex Value="1"/>
<TopLine Value="87"/>
<CursorPos X="113" Y="252"/>
<TopLine Value="90"/>
<CursorPos X="11" Y="108"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit1>
</Units>
<JumpHistory Count="5" HistoryIndex="4">
<JumpHistory Count="4" HistoryIndex="3">
<Position1>
<Filename Value="uMainForm.pas"/>
</Position1>
@ -43,13 +43,9 @@
<Caret Line="77" Column="43" TopLine="52"/>
</Position3>
<Position4>
<Filename Value="uMainForm.pas"/>
<Caret Line="54" Column="3" TopLine="219"/>
</Position4>
<Position5>
<Filename Value="uMainForm.pas"/>
<Caret Line="246" Column="3" TopLine="219"/>
</Position5>
</Position4>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -105,12 +105,20 @@ type
var
MainForm: TMainForm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
uses
uCEFApplication;
uCEFApplication;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TMainForm.HandleKeyUp(const aMsg : TMsg; var aHandled : boolean);
var

View File

@ -55,8 +55,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -68,6 +67,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,8 +8,8 @@
<Unit0>
<Filename Value="JSDialogBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="40"/>
<CursorPos X="32" Y="58"/>
<TopLine Value="39"/>
<CursorPos X="23" Y="58"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="254"/>
<CursorPos X="39" Y="261"/>
<TopLine Value="107"/>
<CursorPos X="40" Y="105"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>

View File

@ -98,6 +98,8 @@ type
var
JSDialogBrowserFrm: TJSDialogBrowserFrm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -112,6 +114,13 @@ uses
// 1. The FormCloseQuery event sets CanClose to False and calls TChromiumWindow.CloseBrowser, which triggers the TChromiumWindow.OnClose event.
// 2. The TChromiumWindow.OnClose event calls TChromiumWindow.DestroyChildWindow which triggers the TChromiumWindow.OnBeforeClose event.
// 3. TChromiumWindow.OnBeforeClose sets FCanClose to True and closes the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TJSDialogBrowserFrm.FormCreate(Sender: TObject);
begin

View File

@ -22,8 +22,8 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<TopLine Value="513"/>
<CursorPos X="42" Y="533"/>
<TopLine Value="538"/>
<CursorPos X="3" Y="540"/>
<UsageCount Value="21"/>
<Bookmarks Count="1">
<Item0 X="85" Y="477" ID="1"/>
@ -118,123 +118,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="uJSEval.pas"/>
<Caret Line="199" Column="51" TopLine="162"/>
<Caret Line="30" Column="122" TopLine="21"/>
</Position1>
<Position2>
<Filename Value="uJSEval.pas"/>
<Caret Line="228" Column="95" TopLine="196"/>
<Caret Line="55" Column="25" TopLine="21"/>
</Position2>
<Position3>
<Filename Value="uJSEval.pas"/>
<Caret Line="30" Column="122" TopLine="21"/>
<Caret Line="115" Column="25" TopLine="79"/>
</Position3>
<Position4>
<Filename Value="uJSEval.pas"/>
<Caret Line="55" Column="25" TopLine="21"/>
<Caret Line="15" Column="103"/>
</Position4>
<Position5>
<Filename Value="uJSEval.pas"/>
<Caret Line="115" Column="25" TopLine="79"/>
<Caret Line="64" Column="90" TopLine="26"/>
</Position5>
<Position6>
<Filename Value="uJSEval.pas"/>
<Caret Line="15" Column="103"/>
<Caret Line="373" Column="76" TopLine="336"/>
</Position6>
<Position7>
<Filename Value="uJSEval.pas"/>
<Caret Line="64" Column="90" TopLine="26"/>
<Caret Line="470" Column="70" TopLine="433"/>
</Position7>
<Position8>
<Filename Value="uJSEval.pas"/>
<Caret Line="373" Column="76" TopLine="336"/>
<Caret Line="524" Column="40" TopLine="487"/>
</Position8>
<Position9>
<Filename Value="uJSEval.pas"/>
<Caret Line="470" Column="70" TopLine="433"/>
<Caret Line="555" Column="39" TopLine="518"/>
</Position9>
<Position10>
<Filename Value="uJSEval.pas"/>
<Caret Line="524" Column="40" TopLine="487"/>
<Caret Line="63" Column="18" TopLine="41"/>
</Position10>
<Position11>
<Filename Value="uJSEval.pas"/>
<Caret Line="555" Column="39" TopLine="518"/>
<Caret Line="373" Column="76" TopLine="336"/>
</Position11>
<Position12>
<Filename Value="uJSEval.pas"/>
<Caret Line="63" Column="18" TopLine="41"/>
<Filename Value="JSEval.lpr"/>
<Caret Line="60" Column="76" TopLine="44"/>
</Position12>
<Position13>
<Filename Value="uJSEval.pas"/>
<Caret Line="373" Column="76" TopLine="336"/>
<Caret Line="125" Column="29" TopLine="114"/>
</Position13>
<Position14>
<Filename Value="JSEval.lpr"/>
<Caret Line="60" Column="76" TopLine="44"/>
<Filename Value="uJSEval.pas"/>
<Caret Line="536" Column="38" TopLine="518"/>
</Position14>
<Position15>
<Filename Value="uJSEval.pas"/>
<Caret Line="125" Column="29" TopLine="114"/>
<Caret Line="511" Column="75" TopLine="499"/>
</Position15>
<Position16>
<Filename Value="uJSEval.pas"/>
<Caret Line="536" Column="38" TopLine="518"/>
<Caret Line="463" Column="50" TopLine="452"/>
</Position16>
<Position17>
<Filename Value="uJSEval.pas"/>
<Caret Line="511" Column="75" TopLine="499"/>
<Caret Line="372" TopLine="360"/>
</Position17>
<Position18>
<Filename Value="uJSEval.pas"/>
<Caret Line="463" Column="50" TopLine="452"/>
<Caret Line="54" Column="73" TopLine="24"/>
</Position18>
<Position19>
<Filename Value="uJSEval.pas"/>
<Caret Line="372" TopLine="360"/>
<Caret Line="51" Column="90" TopLine="24"/>
</Position19>
<Position20>
<Filename Value="uJSEval.pas"/>
<Caret Line="54" Column="73" TopLine="24"/>
<Caret Line="59" Column="37" TopLine="24"/>
</Position20>
<Position21>
<Filename Value="uJSEval.pas"/>
<Caret Line="51" Column="90" TopLine="24"/>
<Caret Line="181" Column="63" TopLine="162"/>
</Position21>
<Position22>
<Filename Value="uJSEval.pas"/>
<Caret Line="59" Column="37" TopLine="24"/>
<Filename Value="JSEval.lpr"/>
<Caret Line="60" Column="76" TopLine="41"/>
</Position22>
<Position23>
<Filename Value="uJSEval.pas"/>
<Caret Line="181" Column="63" TopLine="162"/>
<Caret Line="125" Column="11" TopLine="121"/>
</Position23>
<Position24>
<Filename Value="JSEval.lpr"/>
<Caret Line="60" Column="76" TopLine="41"/>
<Filename Value="uJSEval.pas"/>
<Caret Line="542" Column="86" TopLine="533"/>
</Position24>
<Position25>
<Filename Value="uJSEval.pas"/>
<Caret Line="125" Column="11" TopLine="121"/>
<Caret Line="94" Column="43" TopLine="77"/>
</Position25>
<Position26>
<Filename Value="uJSEval.pas"/>
<Caret Line="542" Column="86" TopLine="533"/>
<Caret Line="210" Column="39" TopLine="203"/>
</Position26>
<Position27>
<Filename Value="uJSEval.pas"/>
<Caret Line="94" Column="43" TopLine="77"/>
<Caret Line="86" Column="71" TopLine="76"/>
</Position27>
<Position28>
<Filename Value="uJSEval.pas"/>
<Caret Line="210" Column="39" TopLine="203"/>
<Caret Line="510" Column="62" TopLine="492"/>
</Position28>
<Position29>
<Filename Value="uJSEval.pas"/>
<Caret Line="86" Column="71" TopLine="76"/>
<Filename Value="JSEval.lpr"/>
<Caret Line="60" Column="76" TopLine="41"/>
</Position29>
<Position30>
<Filename Value="uJSEval.pas"/>
<Caret Line="510" Column="62" TopLine="492"/>
<Caret Line="126" Column="11" TopLine="109"/>
</Position30>
</JumpHistory>
<RunParams>

View File

@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="206"/>
<CursorPos X="39" Y="213"/>
<TopLine Value="174"/>
<CursorPos X="3" Y="176"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -53,7 +53,7 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit4>
</Units>
<JumpHistory Count="7" HistoryIndex="6">
<JumpHistory Count="9" HistoryIndex="8">
<Position1>
<Filename Value="uJSExecutingFunctions.pas"/>
</Position1>
@ -81,6 +81,14 @@
<Filename Value="uJSExecutingFunctions.pas"/>
<Caret Line="87" Column="43" TopLine="84"/>
</Position7>
<Position8>
<Filename Value="JSExecutingFunctions.lpr"/>
<Caret Line="59" Column="17" TopLine="41"/>
</Position8>
<Position9>
<Filename Value="uJSExecutingFunctions.pas"/>
<Caret Line="116" Column="11" TopLine="100"/>
</Position9>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="134"/>
<CursorPos X="59" Y="88"/>
<TopLine Value="220"/>
<CursorPos X="3" Y="222"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -50,7 +50,7 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit3>
</Units>
<JumpHistory Count="7" HistoryIndex="6">
<JumpHistory Count="9" HistoryIndex="8">
<Position1>
<Filename Value="uJSExtension.pas"/>
</Position1>
@ -78,6 +78,14 @@
<Filename Value="uJSExtension.pas"/>
<Caret Line="312" Column="54" TopLine="301"/>
</Position7>
<Position8>
<Filename Value="JSExtension.lpr"/>
<Caret Line="60" Column="17" TopLine="42"/>
</Position8>
<Position9>
<Filename Value="uJSExtension.pas"/>
<Caret Line="126" TopLine="111"/>
</Position9>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -20,9 +20,10 @@
<ComponentName Value="JSExtensionWithFunctionFrm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="63"/>
<CursorPos X="15" Y="78"/>
<TopLine Value="149"/>
<CursorPos X="3" Y="151"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -31,7 +32,6 @@
<Unit2>
<Filename Value="uMyV8Handler.pas"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<TopLine Value="50"/>
<CursorPos X="74" Y="69"/>
@ -56,7 +56,7 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit4>
</Units>
<JumpHistory Count="10" HistoryIndex="9">
<JumpHistory Count="12" HistoryIndex="11">
<Position1>
<Filename Value="uJSExtensionWithFunction.pas"/>
</Position1>
@ -96,6 +96,14 @@
<Filename Value="uJSExtensionWithFunction.pas"/>
<Caret Line="78" Column="15" TopLine="63"/>
</Position10>
<Position11>
<Filename Value="JSExtensionWithFunction.lpr"/>
<Caret Line="59" Column="17" TopLine="45"/>
</Position11>
<Position12>
<Filename Value="uJSExtensionWithFunction.pas"/>
<Caret Line="105" Column="11" TopLine="89"/>
</Position12>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -51,8 +51,6 @@ uses
LCLIntf, LCLType, LMessages, Interfaces,
{$ENDIF }
uCEFApplication,
uCEFTypes,
uCEFConstants,
uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm},
uPreferences in 'uPreferences.pas' {PreferencesFrm},
uSimpleTextViewer in 'uSimpleTextViewer.pas' {SimpleTextViewerFrm};
@ -62,10 +60,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin

View File

@ -8,8 +8,8 @@
<Unit0>
<Filename Value="MiniBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="47"/>
<CursorPos X="18" Y="50"/>
<TopLine Value="46"/>
<CursorPos Y="54"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="191"/>
<CursorPos X="78" Y="204"/>
<TopLine Value="277"/>
<CursorPos X="3" Y="279"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -64,7 +64,7 @@
<UsageCount Value="10"/>
</Unit5>
</Units>
<JumpHistory Count="23" HistoryIndex="22">
<JumpHistory Count="25" HistoryIndex="24">
<Position1>
<Filename Value="uMiniBrowser.pas"/>
</Position1>
@ -156,6 +156,14 @@
<Filename Value="uMiniBrowser.pas"/>
<Caret Line="590" Column="20" TopLine="573"/>
</Position23>
<Position24>
<Filename Value="MiniBrowser.lpr"/>
<Caret Line="54" TopLine="46"/>
</Position24>
<Position25>
<Filename Value="uMiniBrowser.pas"/>
<Caret Line="261" Column="11" TopLine="245"/>
</Position25>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -258,6 +258,8 @@ type
var
MiniBrowserFrm : TMiniBrowserFrm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -270,6 +272,15 @@ uses
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
begin

View File

@ -4,7 +4,7 @@
<PathDelim Value="\"/>
<Version Value="11"/>
<BuildModes Active="Default"/>
<Units Count="5">
<Units Count="6">
<Unit0>
<Filename Value="OSRExternalPumpBrowser.lpr"/>
<IsPartOfProject Value="True"/>
@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="102"/>
<CursorPos X="382" Y="102"/>
<TopLine Value="939"/>
<CursorPos X="68" Y="957"/>
<UsageCount Value="26"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -51,127 +51,135 @@
<CursorPos X="32" Y="68"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
<EditorIndex Value="2"/>
<TopLine Value="5667"/>
<CursorPos Y="5683"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit5>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="92" Column="51" TopLine="81"/>
<Caret Line="316" Column="66" TopLine="313"/>
</Position1>
<Position2>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="629" Column="55" TopLine="604"/>
<Caret Line="101" Column="84" TopLine="90"/>
</Position2>
<Position3>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="92" Column="27" TopLine="71"/>
<Caret Line="346" TopLine="343"/>
</Position3>
<Position4>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="313" Column="19" TopLine="289"/>
<Caret Line="192" Column="54" TopLine="173"/>
</Position4>
<Position5>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="93" Column="87" TopLine="82"/>
<Caret Line="194" Column="47" TopLine="173"/>
</Position5>
<Position6>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="237" Column="71" TopLine="234"/>
<Caret Line="199" Column="13" TopLine="187"/>
</Position6>
<Position7>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="97" Column="82" TopLine="86"/>
<Caret Line="120" Column="5" TopLine="109"/>
</Position7>
<Position8>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="316" Column="66" TopLine="313"/>
<Caret Line="47" Column="39" TopLine="42"/>
</Position8>
<Position9>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="101" Column="84" TopLine="90"/>
<Caret Line="311" Column="51" TopLine="294"/>
</Position9>
<Position10>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="346" TopLine="343"/>
<Caret Line="97" Column="43" TopLine="84"/>
</Position10>
<Position11>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="192" Column="54" TopLine="173"/>
<Caret Line="284" Column="57" TopLine="273"/>
</Position11>
<Position12>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="194" Column="47" TopLine="173"/>
<Caret Line="323" Column="23" TopLine="299"/>
</Position12>
<Position13>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="199" Column="13" TopLine="187"/>
<Caret Line="95" Column="36" TopLine="84"/>
</Position13>
<Position14>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="120" Column="5" TopLine="109"/>
<Caret Line="271" TopLine="270"/>
</Position14>
<Position15>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="47" Column="39" TopLine="42"/>
<Caret Line="286" Column="70" TopLine="270"/>
</Position15>
<Position16>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="311" Column="51" TopLine="294"/>
<Caret Line="307" Column="11" TopLine="295"/>
</Position16>
<Position17>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="97" Column="43" TopLine="84"/>
<Caret Line="322" TopLine="313"/>
</Position17>
<Position18>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="284" Column="57" TopLine="273"/>
<Caret Line="503" Column="53" TopLine="488"/>
</Position18>
<Position19>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="323" Column="23" TopLine="299"/>
<Caret Line="92" Column="27" TopLine="92"/>
</Position19>
<Position20>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="95" Column="36" TopLine="84"/>
<Caret Line="503" Column="11" TopLine="499"/>
</Position20>
<Position21>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="271" TopLine="270"/>
<Caret Line="201" Column="11" TopLine="166"/>
</Position21>
<Position22>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="286" Column="70" TopLine="270"/>
<Caret Line="982" Column="68" TopLine="963"/>
</Position22>
<Position23>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="307" Column="11" TopLine="295"/>
<Caret Line="307" Column="39" TopLine="301"/>
</Position23>
<Position24>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="322" TopLine="313"/>
<Caret Line="82" Column="44" TopLine="77"/>
</Position24>
<Position25>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="503" Column="53" TopLine="488"/>
<Caret Line="957" TopLine="939"/>
</Position25>
<Position26>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="92" Column="27" TopLine="92"/>
<Caret Line="958" TopLine="939"/>
</Position26>
<Position27>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="503" Column="11" TopLine="499"/>
<Caret Line="957" TopLine="939"/>
</Position27>
<Position28>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="201" Column="11" TopLine="166"/>
<Caret Line="958" TopLine="939"/>
</Position28>
<Position29>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="982" Column="68" TopLine="963"/>
<Caret Line="960" TopLine="939"/>
</Position29>
<Position30>
<Filename Value="uOSRExternalPumpBrowser.pas"/>
<Caret Line="307" Column="39" TopLine="301"/>
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
<Caret Line="5683" TopLine="5667"/>
</Position30>
</JumpHistory>
<RunParams>

View File

@ -194,7 +194,8 @@ begin
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.MultiThreadedMessageLoop := False;
//GlobalCEFApp.DisableFeatures := 'NetworkService';
GlobalCEFApp.OnScheduleMessagePumpWork := @GlobalCEFApp_OnScheduleMessagePumpWork;
end;
@ -952,6 +953,8 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
end;
end;

View File

@ -58,10 +58,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.DisableFeatures := 'NetworkService';
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -73,6 +70,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,10 +8,9 @@
<Unit0>
<Filename Value="PopupBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="42"/>
<CursorPos X="40" Y="64"/>
<EditorIndex Value="2"/>
<TopLine Value="33"/>
<CursorPos X="54" Y="47"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -22,8 +21,8 @@
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<TopLine Value="198"/>
<CursorPos X="3" Y="209"/>
<TopLine Value="42"/>
<CursorPos X="39" Y="189"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -35,16 +34,16 @@
<ComponentName Value="ChildForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<EditorIndex Value="2"/>
<TopLine Value="272"/>
<CursorPos X="72" Y="287"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="888"/>
<CursorPos X="78" Y="906"/>
<UsageCount Value="22"/>
<Bookmarks Count="2">
<Item0 X="64" Y="173" ID="2"/>
<Item1 Y="704" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit2>
<Unit3>
@ -56,127 +55,63 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit3>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<JumpHistory Count="14" HistoryIndex="13">
<Position1>
<Filename Value="uChildForm.pas"/>
<Caret Line="149" Column="74" TopLine="137"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="81" Column="34" TopLine="68"/>
</Position1>
<Position2>
<Filename Value="uChildForm.pas"/>
<Caret Line="84" Column="24" TopLine="73"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="126" Column="69" TopLine="106"/>
</Position2>
<Position3>
<Filename Value="uChildForm.pas"/>
<Caret Line="942" Column="31" TopLine="922"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="127" Column="44" TopLine="107"/>
</Position3>
<Position4>
<Filename Value="uChildForm.pas"/>
<Caret Line="107" Column="47" TopLine="104"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="248" Column="33" TopLine="241"/>
</Position4>
<Position5>
<Filename Value="uChildForm.pas"/>
<Caret Line="109" Column="23" TopLine="104"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="249" Column="20" TopLine="241"/>
</Position5>
<Position6>
<Filename Value="uChildForm.pas"/>
<Caret Line="145" Column="68" TopLine="125"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="269" Column="33" TopLine="262"/>
</Position6>
<Position7>
<Filename Value="uChildForm.pas"/>
<Caret Line="174" Column="21" TopLine="154"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="270" Column="20" TopLine="262"/>
</Position7>
<Position8>
<Filename Value="uChildForm.pas"/>
<Caret Line="175" Column="43" TopLine="155"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="271" Column="24" TopLine="262"/>
</Position8>
<Position9>
<Filename Value="uChildForm.pas"/>
<Caret Line="688" Column="24" TopLine="668"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="272" Column="31" TopLine="262"/>
</Position9>
<Position10>
<Filename Value="uChildForm.pas"/>
<Caret Line="109" Column="51" TopLine="102"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="280" Column="35" TopLine="261"/>
</Position10>
<Position11>
<Filename Value="uChildForm.pas"/>
<Caret Line="9" Column="72"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="205" Column="39" TopLine="199"/>
</Position11>
<Position12>
<Filename Value="uChildForm.pas"/>
<Caret Line="84" Column="52" TopLine="64"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="76" Column="384" TopLine="76"/>
</Position12>
<Position13>
<Filename Value="uChildForm.pas"/>
<Caret Line="943" Column="59" TopLine="923"/>
<Filename Value="uMainForm.pas"/>
<Caret Line="189" Column="39" TopLine="42"/>
</Position13>
<Position14>
<Filename Value="uChildForm.pas"/>
<Caret Line="945" Column="9" TopLine="925"/>
<Caret Line="75" Column="33" TopLine="62"/>
</Position14>
<Position15>
<Filename Value="uChildForm.pas"/>
<Caret Line="84" Column="47" TopLine="73"/>
</Position15>
<Position16>
<Filename Value="uChildForm.pas"/>
<Caret Line="945" Column="4" TopLine="923"/>
</Position16>
<Position17>
<Filename Value="uChildForm.pas"/>
<Caret Line="114" Column="44" TopLine="96"/>
</Position17>
<Position18>
<Filename Value="uMainForm.pas"/>
<Caret Line="81" Column="34" TopLine="68"/>
</Position18>
<Position19>
<Filename Value="uMainForm.pas"/>
<Caret Line="126" Column="69" TopLine="106"/>
</Position19>
<Position20>
<Filename Value="uMainForm.pas"/>
<Caret Line="127" Column="44" TopLine="107"/>
</Position20>
<Position21>
<Filename Value="uMainForm.pas"/>
<Caret Line="248" Column="33" TopLine="241"/>
</Position21>
<Position22>
<Filename Value="uMainForm.pas"/>
<Caret Line="249" Column="20" TopLine="241"/>
</Position22>
<Position23>
<Filename Value="uMainForm.pas"/>
<Caret Line="269" Column="33" TopLine="262"/>
</Position23>
<Position24>
<Filename Value="uMainForm.pas"/>
<Caret Line="270" Column="20" TopLine="262"/>
</Position24>
<Position25>
<Filename Value="uMainForm.pas"/>
<Caret Line="271" Column="24" TopLine="262"/>
</Position25>
<Position26>
<Filename Value="uMainForm.pas"/>
<Caret Line="272" Column="31" TopLine="262"/>
</Position26>
<Position27>
<Filename Value="uMainForm.pas"/>
<Caret Line="280" Column="35" TopLine="261"/>
</Position27>
<Position28>
<Filename Value="uMainForm.pas"/>
<Caret Line="205" Column="39" TopLine="199"/>
</Position28>
<Position29>
<Filename Value="uMainForm.pas"/>
<Caret Line="76" Column="384" TopLine="76"/>
</Position29>
<Position30>
<Filename Value="uChildForm.pas"/>
<Caret Line="96" Column="382" TopLine="77"/>
</Position30>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -902,6 +902,8 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
end;
end;

View File

@ -107,6 +107,8 @@ type
var
MainForm: TMainForm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -138,7 +140,15 @@ uses
// 2. When all the child forms are closed then FormCloseQuery is triggered again, sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 3. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 4. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

View File

@ -58,9 +58,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.DisableFeatures := 'NetworkService';
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -72,6 +70,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,9 +8,8 @@
<Unit0>
<Filename Value="PopupBrowser2.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<TopLine Value="42"/>
<CursorPos X="35" Y="63"/>
<CursorPos X="61" Y="64"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -21,9 +20,10 @@
<ComponentName Value="MainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="198"/>
<CursorPos X="39" Y="205"/>
<TopLine Value="141"/>
<CursorPos X="11" Y="110"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>

View File

@ -107,6 +107,8 @@ type
var
MainForm: TMainForm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -138,7 +140,14 @@ uses
// 2. When all the child forms are closed then FormCloseQuery is triggered again, sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 3. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 4. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.EnableHighDPISupport := True;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

View File

@ -47,7 +47,7 @@ uses
Forms, Interfaces,
Windows,
{$ENDIF }
uCEFApplication, uCEFConstants,
uCEFApplication,
uPostInspectorBrowser in 'uPostInspectorBrowser.pas' {Form1};
//{$R *.res}
@ -57,7 +57,7 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -69,6 +69,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,8 +8,9 @@
<Unit0>
<Filename Value="PostInspectorBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="38"/>
<CursorPos X="3" Y="53"/>
<IsVisibleTab Value="True"/>
<TopLine Value="41"/>
<CursorPos Y="73"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -20,10 +21,9 @@
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="361"/>
<CursorPos X="39" Y="368"/>
<TopLine Value="109"/>
<CursorPos X="11" Y="121"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>

View File

@ -118,6 +118,8 @@ type
var
Form1: TForm1;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -140,6 +142,13 @@ uses
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

View File

@ -51,18 +51,7 @@ uses
{$SetPEFlags $20}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
// In case you want to use custom directories for the CEF3 binaries, cache, cookies and user data.
{
GlobalCEFApp.FrameworkDirPath := 'cef';
GlobalCEFApp.ResourcesDirPath := 'cef';
GlobalCEFApp.LocalesDirPath := 'cef\locales';
GlobalCEFApp.cache := 'cef\cache';
GlobalCEFApp.UserDataPath := 'cef\User Data';
}
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -71,6 +60,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,10 +8,9 @@
<Unit0>
<Filename Value="SimpleBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="40"/>
<CursorPos X="32" Y="55"/>
<TopLine Value="32"/>
<CursorPos X="101" Y="63"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -22,8 +21,9 @@
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<TopLine Value="165"/>
<CursorPos X="53" Y="177"/>
<IsVisibleTab Value="True"/>
<TopLine Value="135"/>
<CursorPos X="64" Y="129"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -38,7 +38,7 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit2>
</Units>
<JumpHistory Count="2" HistoryIndex="1">
<JumpHistory Count="4" HistoryIndex="3">
<Position1>
<Filename Value="uSimpleBrowser.pas"/>
<Caret Line="4" Column="8"/>
@ -47,6 +47,14 @@
<Filename Value="uSimpleBrowser.pas"/>
<Caret Line="83" Column="386" TopLine="59"/>
</Position2>
<Position3>
<Filename Value="SimpleBrowser.lpr"/>
<Caret Line="63" Column="101" TopLine="32"/>
</Position3>
<Position4>
<Filename Value="uSimpleBrowser.pas"/>
<Caret Line="92" Column="11" TopLine="91"/>
</Position4>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -89,6 +89,8 @@ type
var
Form1: TForm1;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -113,7 +115,22 @@ uses
// 1. The FormCloseQuery event sets CanClose to False and calls TChromiumWindow.CloseBrowser, which triggers the TChromiumWindow.OnClose event.
// 2. The TChromiumWindow.OnClose event calls TChromiumWindow.DestroyChildWindow which triggers the TChromiumWindow.OnBeforeClose event.
// 3. TChromiumWindow.OnBeforeClose sets FCanClose to True and closes the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
// In case you want to use custom directories for the CEF3 binaries, cache, cookies and user data.
{
GlobalCEFApp.FrameworkDirPath := 'cef';
GlobalCEFApp.ResourcesDirPath := 'cef';
GlobalCEFApp.LocalesDirPath := 'cef\locales';
GlobalCEFApp.cache := 'cef\cache';
GlobalCEFApp.UserDataPath := 'cef\User Data';
}
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin

View File

@ -19,17 +19,16 @@ uses
{$ENDIF}
begin
GlobalCEFApp := TCefApplication.Create;
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
RequireDerivedFormResource:=True;
RequireDerivedFormResource := True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -8,7 +8,11 @@
<Unit0>
<Filename Value="SimpleBrowser2.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<CursorPos X="34" Y="26"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="uSimpleBrowser2.pas"/>
@ -31,9 +35,8 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="uSimpleLazarusBrowser"/>
<IsVisibleTab Value="True"/>
<TopLine Value="148"/>
<CursorPos X="39" Y="155"/>
<TopLine Value="69"/>
<CursorPos X="11" Y="96"/>
<UsageCount Value="43"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>

View File

@ -93,6 +93,8 @@ type
var
Form1 : TForm1;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -115,6 +117,13 @@ uses
uCEFApplication;
{ TForm1 }
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin

View File

@ -22,15 +22,15 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="154"/>
<CursorPos X="39" Y="160"/>
<TopLine Value="111"/>
<CursorPos X="41" Y="122"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit1>
</Units>
<JumpHistory Count="5" HistoryIndex="4">
<JumpHistory Count="7" HistoryIndex="6">
<Position1>
<Filename Value="SimpleExternalPumpBrowser.lpr"/>
</Position1>
@ -50,6 +50,14 @@
<Filename Value="uSimpleExternalPumpBrowser.pas"/>
<Caret Line="74" Column="386" TopLine="52"/>
</Position5>
<Position6>
<Filename Value="SimpleExternalPumpBrowser.lpr"/>
<Caret Line="54" Column="3" TopLine="50"/>
</Position6>
<Position7>
<Filename Value="uSimpleExternalPumpBrowser.pas"/>
<Caret Line="89" Column="11" TopLine="73"/>
</Position7>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -118,7 +118,8 @@ begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.ExternalMessagePump := True;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.MultiThreadedMessageLoop := False;
GlobalCEFApp.DisableFeatures := 'NetworkService';
GlobalCEFApp.OnScheduleMessagePumpWork := GlobalCEFApp_OnScheduleMessagePumpWork;
end;

View File

@ -53,9 +53,7 @@ uses
{$R *.res}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin

View File

@ -8,7 +8,11 @@
<Unit0>
<Filename Value="SimpleOSRBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="34"/>
<CursorPos X="22" Y="56"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit0>
<Unit1>
@ -34,11 +38,11 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<TopLine Value="269"/>
<CursorPos X="39" Y="276"/>
<TopLine Value="919"/>
<CursorPos X="78" Y="936"/>
<UsageCount Value="42"/>
<Bookmarks Count="1">
<Item0 X="40" Y="251" ID="4"/>
<Item0 X="40" Y="262" ID="4"/>
</Bookmarks>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -225,7 +229,7 @@
<UsageCount Value="10"/>
</Unit26>
</Units>
<JumpHistory Count="4" HistoryIndex="3">
<JumpHistory Count="5" HistoryIndex="4">
<Position1>
<Filename Value="usimplelazosrbrowser.pas"/>
<Caret Line="204" Column="63" TopLine="19"/>
@ -242,6 +246,10 @@
<Filename Value="usimplelazosrbrowser.pas"/>
<Caret Line="99" Column="382" TopLine="73"/>
</Position4>
<Position5>
<Filename Value="usimplelazosrbrowser.pas"/>
<Caret Line="155" Column="11" TopLine="140"/>
</Position5>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -152,6 +152,8 @@ type
var
Form1: TForm1;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -166,6 +168,15 @@ uses
// set "Result" to false and CEF3 will destroy the internal browser immediately.
// 3- chrmosr.OnBeforeClose is triggered because the internal browser was destroyed.
// Now we set FCanClose to True and send WM_CLOSE to the form.
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.WindowlessRenderingEnabled := True;
GlobalCEFApp.EnableHighDPISupport := True;
//GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TForm1.GoBtnClick(Sender: TObject);
begin
@ -921,6 +932,8 @@ begin
TempKeyEvent.focus_on_editable_field := ord(False);
chrmosr.SendKeyEvent(@TempKeyEvent);
if (Key in [VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_TAB]) then Key := 0;
end;
end;

View File

@ -8,7 +8,7 @@
<Unit0>
<Filename Value="SimpleBrowser.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="21"/>
<TopLine Value="36"/>
<CursorPos X="14" Y="44"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
@ -20,9 +20,8 @@
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/>
<TopLine Value="162"/>
<TopLine Value="75"/>
<CursorPos X="39" Y="169"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
@ -32,6 +31,7 @@
<Unit2>
<Filename Value="uCEFLoader.pas"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="51"/>
<CursorPos Y="65"/>

View File

@ -22,15 +22,15 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="436"/>
<CursorPos X="39" Y="444"/>
<TopLine Value="137"/>
<CursorPos X="11" Y="123"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit1>
</Units>
<JumpHistory Count="4" HistoryIndex="3">
<JumpHistory Count="5" HistoryIndex="4">
<Position1>
<Filename Value="TabBrowser.lpr"/>
</Position1>
@ -46,6 +46,10 @@
<Filename Value="uMainForm.pas"/>
<Caret Line="97" Column="386" TopLine="91"/>
</Position4>
<Position5>
<Filename Value="TabBrowser.lpr"/>
<Caret Line="53" Column="3" TopLine="41"/>
</Position5>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -22,8 +22,8 @@
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="67"/>
<CursorPos Y="65"/>
<TopLine Value="113"/>
<CursorPos X="35" Y="117"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -44,7 +44,7 @@
<DefaultSyntaxHighlighter Value="Delphi"/>
</Unit2>
</Units>
<JumpHistory Count="2" HistoryIndex="1">
<JumpHistory Count="3" HistoryIndex="2">
<Position1>
<Filename Value="uMainForm.pas"/>
</Position1>
@ -52,6 +52,10 @@
<Filename Value="uChildForm.pas"/>
<Caret Line="85" Column="43" TopLine="55"/>
</Position2>
<Position3>
<Filename Value="uMainForm.pas"/>
<Caret Line="93" Column="25" TopLine="66"/>
</Position3>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -113,7 +113,8 @@ end;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TMainForm.CreateToolboxChild(const ChildCaption, URL: string);

View File

@ -59,8 +59,7 @@ uses
{$SetPEFlags $20}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin

View File

@ -8,9 +8,8 @@
<Unit0>
<Filename Value="URLRequest.lpr"/>
<IsPartOfProject Value="True"/>
<IsVisibleTab Value="True"/>
<TopLine Value="43"/>
<CursorPos X="32" Y="62"/>
<CursorPos X="18" Y="52"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="Delphi"/>
@ -21,9 +20,10 @@
<ComponentName Value="URLRequestFrm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="101"/>
<CursorPos X="47" Y="115"/>
<TopLine Value="104"/>
<CursorPos X="20" Y="115"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -52,7 +52,7 @@
<UsageCount Value="10"/>
</Unit4>
</Units>
<JumpHistory Count="21" HistoryIndex="20">
<JumpHistory Count="24" HistoryIndex="23">
<Position1>
<Filename Value="uURLRequest.pas"/>
</Position1>
@ -136,6 +136,18 @@
<Filename Value="uURLRequest.pas"/>
<Caret Line="150" Column="54" TopLine="47"/>
</Position21>
<Position22>
<Filename Value="URLRequest.lpr"/>
<Caret Line="62" Column="22" TopLine="43"/>
</Position22>
<Position23>
<Filename Value="uURLRequest.pas"/>
<Caret Line="91" Column="29" TopLine="75"/>
</Position23>
<Position24>
<Filename Value="uURLRequest.pas"/>
<Caret Line="120" Column="3" TopLine="118"/>
</Position24>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>

View File

@ -88,6 +88,8 @@ type
var
URLRequestFrm: TURLRequestFrm;
procedure CreateGlobalCEFApp;
implementation
{$R *.lfm}
@ -110,7 +112,14 @@ implementation
// 3- in the TCEFUrlRequestClientComponent.OnRequestComplete event we set FCanClose to TRUE and send WM_CLOSE to the form.
uses
uCEFMiscFunctions, uCEFTypes, uCEFPostData, uCEFPostDataElement, uCEFConstants;
uCEFApplication, uCEFMiscFunctions, uCEFTypes, uCEFPostData, uCEFPostDataElement, uCEFConstants;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.DisableFeatures := 'NetworkService';
end;
procedure TURLRequestFrm.DownloadBtnClick(Sender: TObject);
var

View File

@ -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="75" Release="7"/>
<Version Major="75" Release="8"/>
<Files Count="143">
<Item1>
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>

View File

@ -62,7 +62,7 @@ uses
const
CEF_SUPPORTED_VERSION_MAJOR = 75;
CEF_SUPPORTED_VERSION_MINOR = 0;
CEF_SUPPORTED_VERSION_RELEASE = 7;
CEF_SUPPORTED_VERSION_RELEASE = 8;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 75;
@ -114,6 +114,7 @@ type
FMultiThreadedMessageLoop : boolean;
FExternalMessagePump : boolean;
FDeleteCache : boolean;
FDeleteCookies : boolean;
FCustomCommandLines : TStringList;
FCustomCommandLineValues : TStringList;
FFlashEnabled : boolean;
@ -280,7 +281,10 @@ type
function ExecuteProcess(const aApp : ICefApp) : integer;
procedure InitializeSettings(var aSettings : TCefSettings);
function InitializeLibrary(const aApp : ICefApp) : boolean;
procedure RenameAndDeleteDir(const aDirectory : string);
procedure RenameAndDeleteDir(const aDirectory : string; aKeepCookies : boolean = False);
procedure DeleteCacheContents(const aDirectory : string);
procedure DeleteCookiesDB(const aDirectory : string);
procedure MoveCookiesDB(const aSrcDirectory, aDstDirectory : string);
function MultiExeProcessing : boolean;
function SingleExeProcessing : boolean;
function CheckCEFLibrary : boolean;
@ -362,6 +366,7 @@ type
property MultiThreadedMessageLoop : boolean read FMultiThreadedMessageLoop write FMultiThreadedMessageLoop;
property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump;
property DeleteCache : boolean read FDeleteCache write FDeleteCache;
property DeleteCookies : boolean read FDeleteCookies write FDeleteCookies;
property FlashEnabled : boolean read FFlashEnabled write FFlashEnabled;
property EnableMediaStream : boolean read FEnableMediaStream write FEnableMediaStream;
property EnableSpeechInput : boolean read FEnableSpeechInput write FEnableSpeechInput;
@ -531,6 +536,7 @@ begin
FMultiThreadedMessageLoop := True;
FExternalMessagePump := False;
FDeleteCache := False;
FDeleteCookies := False;
FFlashEnabled := True;
FEnableMediaStream := True;
FEnableSpeechInput := True;
@ -544,7 +550,7 @@ begin
FOnRegisterCustomSchemes := nil;
FEnableHighDPISupport := False;
FMuteAudio := False;
FSitePerProcess := True;
FSitePerProcess := False;
FDisableWebSecurity := False;
FDisablePDFExtension := False;
FLogProcessInfo := False;
@ -1148,7 +1154,14 @@ begin
try
if (aApp <> nil) then
begin
if FDeleteCache then RenameAndDeleteDir(FCache);
if FDeleteCache and FDeleteCookies then
RenameAndDeleteDir(FCache)
else
if FDeleteCookies then
DeleteCookiesDB(FCache)
else
if FDeleteCache then
RenameAndDeleteDir(FCache, True);
RegisterWidevineCDM;
@ -1176,7 +1189,55 @@ begin
end;
end;
procedure TCefApplication.RenameAndDeleteDir(const aDirectory : string);
procedure TCefApplication.DeleteCacheContents(const aDirectory : string);
var
TempFiles : TStringList;
begin
TempFiles := TStringList.Create;
try
TempFiles.Add('Cookies');
TempFiles.Add('Cookies-journal');
DeleteDirContents(aDirectory, TempFiles);
finally
FreeAndNil(TempFiles);
end;
end;
procedure TCefApplication.DeleteCookiesDB(const aDirectory : string);
var
TempFiles : TStringList;
begin
TempFiles := TStringList.Create;
try
TempFiles.Add(IncludeTrailingPathDelimiter(aDirectory) + 'Cookies');
TempFiles.Add(IncludeTrailingPathDelimiter(aDirectory) + 'Cookies-journal');
DeleteFileList(TempFiles);
finally
FreeAndNil(TempFiles);
end;
end;
procedure TCefApplication.MoveCookiesDB(const aSrcDirectory, aDstDirectory : string);
var
TempFiles : TStringList;
begin
TempFiles := TStringList.Create;
try
TempFiles.Add('Cookies');
TempFiles.Add('Cookies-journal');
MoveFileList(TempFiles, aSrcDirectory, aDstDirectory);
finally
FreeAndNil(TempFiles);
end;
end;
procedure TCefApplication.RenameAndDeleteDir(const aDirectory : string; aKeepCookies : boolean);
var
TempOldDir, TempNewDir : string;
i : integer;
@ -1197,12 +1258,10 @@ begin
TempNewDir := TempOldDir + '(' + inttostr(i) + ')';
until not(DirectoryExists(TempNewDir));
{$IFDEF MSWINDOWS}
if MoveFileW(PWideChar(TempOldDir + chr(0)), PWideChar(TempNewDir + chr(0))) then
{$ELSE}
if RenameFile(TempOldDir, TempNewDir) then
{$ENDIF}
begin
if aKeepCookies then MoveCookiesDB(TempNewDir, TempOldDir);
TempThread := TCEFDirectoryDeleterThread.Create(TempNewDir);
{$IFDEF DELPHI14_UP}
TempThread.Start;
@ -1211,10 +1270,16 @@ begin
{$ENDIF}
end
else
DeleteDirContents(aDirectory);
if aKeepCookies then
DeleteCacheContents(aDirectory)
else
DeleteDirContents(aDirectory);
end
else
DeleteDirContents(aDirectory);
if aKeepCookies then
DeleteCacheContents(aDirectory)
else
DeleteDirContents(aDirectory);
except
on e : exception do
if CustomExceptionHandler('TCefApplication.RenameAndDeleteDir', e) then raise;

View File

@ -75,7 +75,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -187,11 +187,11 @@ end;
// TCustomAudioHandler
constructor TCustomAudioHandler.Create(const events: Pointer);
constructor TCustomAudioHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomAudioHandler.Destroy;

View File

@ -336,18 +336,6 @@ type
procedure HandleList(const aValue : ICefValue; var aResultSL : TStringList; const aRoot, aKey : string);
procedure HandleInvalid(const aValue : ICefValue; var aResultSL : TStringList; const aRoot, aKey : string);
function MustCreateLoadHandler : boolean; virtual;
function MustCreateFocusHandler : boolean; virtual;
function MustCreateContextMenuHandler : boolean; virtual;
function MustCreateDialogHandler : boolean; virtual;
function MustCreateKeyboardHandler : boolean; virtual;
function MustCreateDisplayHandler : boolean; virtual;
function MustCreateDownloadHandler : boolean; virtual;
function MustCreateJsDialogHandler : boolean; virtual;
function MustCreateDragHandler : boolean; virtual;
function MustCreateFindHandler : boolean; virtual;
function MustCreateAudioHandler : boolean; virtual;
{$IFDEF MSWINDOWS}
procedure PrefsAvailableMsg(var aMessage : TMessage);
{$ENDIF}
@ -498,6 +486,22 @@ type
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); virtual;
function MustCreateLoadHandler : boolean; virtual;
function MustCreateFocusHandler : boolean; virtual;
function MustCreateContextMenuHandler : boolean; virtual;
function MustCreateDialogHandler : boolean; virtual;
function MustCreateKeyboardHandler : boolean; virtual;
function MustCreateDisplayHandler : boolean; virtual;
function MustCreateDownloadHandler : boolean; virtual;
function MustCreateJsDialogHandler : boolean; virtual;
function MustCreateLifeSpanHandler : boolean; virtual;
function MustCreateRenderHandler : boolean; virtual;
function MustCreateRequestHandler : boolean; virtual;
function MustCreateDragHandler : boolean; virtual;
function MustCreateFindHandler : boolean; virtual;
function MustCreateAudioHandler : boolean; virtual;
function MustCreateResourceRequestHandler : boolean; virtual;
function MustCreateCookieAccessFilter : boolean; virtual;
public
constructor Create(AOwner: TComponent); override;
@ -1024,22 +1028,7 @@ begin
if (FHandler = nil) then
begin
FIsOSR := aIsOsr;
FHandler := TCustomClientHandler.Create(Self,
MustCreateLoadHandler,
MustCreateFocusHandler,
MustCreateContextMenuHandler,
MustCreateDialogHandler,
MustCreateKeyboardHandler,
MustCreateDisplayHandler,
MustCreateDownloadHandler,
MustCreateJsDialogHandler,
True,
FIsOSR, // Create the Render Handler in OSR mode only
True,
MustCreateDragHandler,
MustCreateFindHandler,
MustCreateAudioHandler);
FHandler := TCustomClientHandler.Create(Self);
Result := True;
end;
except
@ -3059,6 +3048,21 @@ begin
assigned(FOnDialogClosed);
end;
function TChromium.MustCreateLifeSpanHandler : boolean;
begin
Result := True;
end;
function TChromium.MustCreateRenderHandler : boolean;
begin
Result := FIsOSR;
end;
function TChromium.MustCreateRequestHandler : boolean;
begin
Result := True;
end;
function TChromium.MustCreateDragHandler : boolean;
begin
Result := assigned(FOnDragEnter) or
@ -3077,6 +3081,23 @@ begin
assigned(FOnAudioStreamStopped);
end;
function TChromium.MustCreateResourceRequestHandler : boolean;
begin
Result := assigned(FOnBeforeResourceLoad) or
assigned(FOnGetResourceHandler) or
assigned(FOnResourceRedirect) or
assigned(FOnResourceResponse) or
assigned(FOnGetResourceResponseFilter) or
assigned(FOnResourceLoadComplete) or
assigned(FOnProtocolExecution);
end;
function TChromium.MustCreateCookieAccessFilter : boolean;
begin
Result := assigned(FOnCanSendCookie) or
assigned(FOnCanSaveCookie);
end;
{$IFDEF MSWINDOWS}
procedure TChromium.PrefsAvailableMsg(var aMessage : TMessage);
begin
@ -3170,14 +3191,7 @@ begin
InitializeSettings(FDevBrowserSettings);
InitializeDevToolsWindowInfo(aDevTools);
TempClient := TCustomClientHandler.Create(Self, False, False,
False, False,
MustCreateKeyboardHandler,
False, False,
False, False,
False, False,
False, False,
False);
TempClient := TCustomClientHandler.Create(Self, True);
if (inspectElementAt.x <> low(integer)) and
(inspectElementAt.y <> low(integer)) then

View File

@ -137,11 +137,7 @@ type
procedure InitializeVars;
public
constructor Create(const events: IChromiumEvents;
aCreateLoadHandler, aCreateFocusHandler, aCreateContextMenuHandler, aCreateDialogHandler,
aCreateKeyboardHandler, aCreateDisplayHandler, aCreateDownloadHandler, aCreateJsDialogHandler,
aCreateLifeSpanHandler, aCreateRenderHandler, aCreateRequestHandler, aCreateDragHandler,
aCreateFindHandler, aCreateAudioHandler : boolean); reintroduce; virtual;
constructor Create(const events: IChromiumEvents; aDevToolsClient : boolean = False); reintroduce; virtual;
procedure BeforeDestruction; override;
procedure RemoveReferences; override;
end;
@ -628,21 +624,7 @@ end;
// ******************************************************
constructor TCustomClientHandler.Create(const events : IChromiumEvents;
aCreateLoadHandler : boolean;
aCreateFocusHandler : boolean;
aCreateContextMenuHandler : boolean;
aCreateDialogHandler : boolean;
aCreateKeyboardHandler : boolean;
aCreateDisplayHandler : boolean;
aCreateDownloadHandler : boolean;
aCreateJsDialogHandler : boolean;
aCreateLifeSpanHandler : boolean;
aCreateRenderHandler : boolean;
aCreateRequestHandler : boolean;
aCreateDragHandler : boolean;
aCreateFindHandler : boolean;
aCreateAudioHandler : boolean);
constructor TCustomClientHandler.Create(const events : IChromiumEvents; aDevToolsClient : boolean);
begin
inherited Create;
@ -650,22 +632,29 @@ begin
FEvents := Pointer(events);
if (FEvents <> nil) then
if (events <> nil) then
begin
if aCreateLoadHandler then FLoadHandler := TCustomLoadHandler.Create(FEvents);
if aCreateFocusHandler then FFocusHandler := TCustomFocusHandler.Create(FEvents);
if aCreateContextMenuHandler then FContextMenuHandler := TCustomContextMenuHandler.Create(FEvents);
if aCreateDialogHandler then FDialogHandler := TCustomDialogHandler.Create(FEvents);
if aCreateKeyboardHandler then FKeyboardHandler := TCustomKeyboardHandler.Create(FEvents);
if aCreateDisplayHandler then FDisplayHandler := TCustomDisplayHandler.Create(FEvents);
if aCreateDownloadHandler then FDownloadHandler := TCustomDownloadHandler.Create(FEvents);
if aCreateJsDialogHandler then FJsDialogHandler := TCustomJsDialogHandler.Create(FEvents);
if aCreateLifeSpanHandler then FLifeSpanHandler := TCustomLifeSpanHandler.Create(FEvents);
if aCreateRenderHandler then FRenderHandler := TCustomRenderHandler.Create(FEvents);
if aCreateRequestHandler then FRequestHandler := TCustomRequestHandler.Create(FEvents);
if aCreateDragHandler then FDragHandler := TCustomDragHandler.Create(FEvents);
if aCreateFindHandler then FFindHandler := TCustomFindHandler.Create(FEvents);
if aCreateAudioHandler then FAudioHandler := TCustomAudioHandler.Create(FEvents);
if aDevToolsClient then
begin
if events.MustCreateKeyboardHandler then FKeyboardHandler := TCustomKeyboardHandler.Create(events);
end
else
begin
if events.MustCreateLoadHandler then FLoadHandler := TCustomLoadHandler.Create(events);
if events.MustCreateFocusHandler then FFocusHandler := TCustomFocusHandler.Create(events);
if events.MustCreateContextMenuHandler then FContextMenuHandler := TCustomContextMenuHandler.Create(events);
if events.MustCreateDialogHandler then FDialogHandler := TCustomDialogHandler.Create(events);
if events.MustCreateKeyboardHandler then FKeyboardHandler := TCustomKeyboardHandler.Create(events);
if events.MustCreateDisplayHandler then FDisplayHandler := TCustomDisplayHandler.Create(events);
if events.MustCreateDownloadHandler then FDownloadHandler := TCustomDownloadHandler.Create(events);
if events.MustCreateJsDialogHandler then FJsDialogHandler := TCustomJsDialogHandler.Create(events);
if events.MustCreateLifeSpanHandler then FLifeSpanHandler := TCustomLifeSpanHandler.Create(events);
if events.MustCreateRenderHandler then FRenderHandler := TCustomRenderHandler.Create(events);
if events.MustCreateRequestHandler then FRequestHandler := TCustomRequestHandler.Create(events);
if events.MustCreateDragHandler then FDragHandler := TCustomDragHandler.Create(events);
if events.MustCreateFindHandler then FFindHandler := TCustomFindHandler.Create(events);
if events.MustCreateAudioHandler then FAudioHandler := TCustomAudioHandler.Create(events);
end;
end;
end;

View File

@ -77,7 +77,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -214,11 +214,11 @@ end;
// TCustomContextMenuHandler
constructor TCustomContextMenuHandler.Create(const events: Pointer);
constructor TCustomContextMenuHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomContextMenuHandler.Destroy;

View File

@ -82,7 +82,7 @@ type
function CanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean; override;
public
constructor Create(const events: Pointer); reintroduce;
constructor Create(const events : IChromiumEvents); reintroduce;
procedure BeforeDestruction; override;
procedure RemoveReferences; override;
end;
@ -150,12 +150,12 @@ end;
function TCefCookieAccessFilterOwn.CanSendCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const cookie: PCefCookie): boolean;
begin
Result := False;
Result := True;
end;
function TCefCookieAccessFilterOwn.CanSaveCookie(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie): boolean;
begin
Result := False;
Result := True;
end;
procedure TCefCookieAccessFilterOwn.RemoveReferences;
@ -202,11 +202,11 @@ end;
// TCustomCookieAccessFilter
constructor TCustomCookieAccessFilter.Create(const events: Pointer);
constructor TCustomCookieAccessFilter.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
procedure TCustomCookieAccessFilter.BeforeDestruction;

View File

@ -76,7 +76,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -158,11 +158,11 @@ end;
// TCustomDialogHandler
constructor TCustomDialogHandler.Create(const events: Pointer);
constructor TCustomDialogHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomDialogHandler.Destroy;

View File

@ -92,7 +92,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -330,11 +330,11 @@ end;
// TCustomDisplayHandler
constructor TCustomDisplayHandler.Create(const events: Pointer);
constructor TCustomDisplayHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomDisplayHandler.Destroy;

View File

@ -73,7 +73,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -148,11 +148,11 @@ end;
// TCustomDownloadHandler
constructor TCustomDownloadHandler.Create(const events: Pointer);
constructor TCustomDownloadHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomDownloadHandler.Destroy;

View File

@ -73,7 +73,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -153,11 +153,11 @@ end;
// TCustomDragHandler
constructor TCustomDragHandler.Create(const events: Pointer);
constructor TCustomDragHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomDragHandler.Destroy;

View File

@ -319,18 +319,6 @@ type
procedure HandleList(const aValue : ICefValue; var aResultSL : TStringList; const aRoot, aKey : string);
procedure HandleInvalid(const aValue : ICefValue; var aResultSL : TStringList; const aRoot, aKey : string);
function MustCreateLoadHandler : boolean; virtual;
function MustCreateFocusHandler : boolean; virtual;
function MustCreateContextMenuHandler : boolean; virtual;
function MustCreateDialogHandler : boolean; virtual;
function MustCreateKeyboardHandler : boolean; virtual;
function MustCreateDisplayHandler : boolean; virtual;
function MustCreateDownloadHandler : boolean; virtual;
function MustCreateJsDialogHandler : boolean; virtual;
function MustCreateDragHandler : boolean; virtual;
function MustCreateFindHandler : boolean; virtual;
function MustCreateAudioHandler : boolean; virtual;
procedure ApplyZoomStep;
function GetParentForm : TCustomForm;
@ -465,6 +453,22 @@ type
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings); virtual;
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; virtual;
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); virtual;
function MustCreateLoadHandler : boolean; virtual;
function MustCreateFocusHandler : boolean; virtual;
function MustCreateContextMenuHandler : boolean; virtual;
function MustCreateDialogHandler : boolean; virtual;
function MustCreateKeyboardHandler : boolean; virtual;
function MustCreateDisplayHandler : boolean; virtual;
function MustCreateDownloadHandler : boolean; virtual;
function MustCreateJsDialogHandler : boolean; virtual;
function MustCreateLifeSpanHandler : boolean; virtual;
function MustCreateRenderHandler : boolean; virtual;
function MustCreateRequestHandler : boolean; virtual;
function MustCreateDragHandler : boolean; virtual;
function MustCreateFindHandler : boolean; virtual;
function MustCreateAudioHandler : boolean; virtual;
function MustCreateResourceRequestHandler : boolean; virtual;
function MustCreateCookieAccessFilter : boolean; virtual;
public
constructor Create(AOwner: TComponent); override;
@ -928,22 +932,7 @@ begin
if (FHandler = nil) then
begin
FIsOSR := aIsOsr;
FHandler := TCustomClientHandler.Create(Self,
MustCreateLoadHandler,
MustCreateFocusHandler,
MustCreateContextMenuHandler,
MustCreateDialogHandler,
MustCreateKeyboardHandler,
MustCreateDisplayHandler,
MustCreateDownloadHandler,
MustCreateJsDialogHandler,
True,
FIsOSR,
True,
MustCreateDragHandler,
MustCreateFindHandler,
MustCreateAudioHandler);
FHandler := TCustomClientHandler.Create(Self);
Result := True;
end;
except
@ -2778,6 +2767,21 @@ begin
assigned(FOnDialogClosed);
end;
function TFMXChromium.MustCreateLifeSpanHandler : boolean;
begin
Result := True;
end;
function TFMXChromium.MustCreateRenderHandler : boolean;
begin
Result := FIsOSR;
end;
function TFMXChromium.MustCreateRequestHandler : boolean;
begin
Result := True;
end;
function TFMXChromium.MustCreateDragHandler : boolean;
begin
Result := assigned(FOnDragEnter) or
@ -2796,6 +2800,23 @@ begin
assigned(FOnAudioStreamStopped);
end;
function TFMXChromium.MustCreateResourceRequestHandler : boolean;
begin
Result := assigned(FOnBeforeResourceLoad) or
assigned(FOnGetResourceHandler) or
assigned(FOnResourceRedirect) or
assigned(FOnResourceResponse) or
assigned(FOnGetResourceResponseFilter) or
assigned(FOnResourceLoadComplete) or
assigned(FOnProtocolExecution);
end;
function TFMXChromium.MustCreateCookieAccessFilter : boolean;
begin
Result := assigned(FOnCanSendCookie) or
assigned(FOnCanSaveCookie);
end;
procedure TFMXChromium.doTextResultAvailable(const aText : ustring);
begin
if assigned(FOnTextResultAvailable) then FOnTextResultAvailable(self, aText);

View File

@ -71,7 +71,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -120,11 +120,11 @@ end;
// TCustomFindHandler
constructor TCustomFindHandler.Create(const events: Pointer);
constructor TCustomFindHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomFindHandler.Destroy;

View File

@ -75,7 +75,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events : Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -161,11 +161,11 @@ end;
// TCustomFocusHandler
constructor TCustomFocusHandler.Create(const events: Pointer);
constructor TCustomFocusHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomFocusHandler.Destroy;

View File

@ -388,7 +388,22 @@ type
procedure doResolvedHostAvailable(result: TCefErrorCode; const resolvedIps: TStrings);
function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean;
procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage);
function MustCreateLoadHandler : boolean;
function MustCreateFocusHandler : boolean;
function MustCreateContextMenuHandler : boolean;
function MustCreateDialogHandler : boolean;
function MustCreateKeyboardHandler : boolean;
function MustCreateDisplayHandler : boolean;
function MustCreateDownloadHandler : boolean;
function MustCreateJsDialogHandler : boolean;
function MustCreateLifeSpanHandler : boolean;
function MustCreateRenderHandler : boolean;
function MustCreateRequestHandler : boolean;
function MustCreateDragHandler : boolean;
function MustCreateFindHandler : boolean;
function MustCreateAudioHandler : boolean;
function MustCreateResourceRequestHandler : boolean;
function MustCreateCookieAccessFilter : boolean;
end;
IServerEvents = interface

View File

@ -77,7 +77,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -209,11 +209,11 @@ end;
// TCustomJsDialogHandler
constructor TCustomJsDialogHandler.Create(const events: Pointer);
constructor TCustomJsDialogHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomJsDialogHandler.Destroy;

View File

@ -73,7 +73,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -153,11 +153,11 @@ end;
// TCustomKeyboardHandler
constructor TCustomKeyboardHandler.Create(const events: Pointer);
constructor TCustomKeyboardHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomKeyboardHandler.Destroy;

View File

@ -77,7 +77,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -238,11 +238,11 @@ end;
// TCustomLifeSpanHandler
constructor TCustomLifeSpanHandler.Create(const events: Pointer);
constructor TCustomLifeSpanHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomLifeSpanHandler.Destroy;

View File

@ -77,7 +77,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -211,11 +211,11 @@ end;
// TCustomLoadHandler
constructor TCustomLoadHandler.Create(const events : Pointer);
constructor TCustomLoadHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomLoadHandler.Destroy;

View File

@ -228,7 +228,9 @@ procedure LogicalToDevice(var aRect : TCEFRect; const aDeviceScaleFactor : doubl
function GetScreenDPI : integer;
function GetDeviceScaleFactor : single;
function DeleteDirContents(const aDirectory : string) : boolean;
function DeleteDirContents(const aDirectory : string; const aExcludeFiles : TStringList = nil) : boolean;
function DeleteFileList(const aFileList : TStringList) : boolean;
function MoveFileList(const aFileList : TStringList; const aSrcDirectory, aDstDirectory : string) : boolean;
implementation
@ -1938,10 +1940,11 @@ begin
Result := GetScreenDPI / 96;
end;
function DeleteDirContents(const aDirectory : string) : boolean;
function DeleteDirContents(const aDirectory : string; const aExcludeFiles : TStringList) : boolean;
var
TempRec : TSearchRec;
TempPath : string;
TempIdx : integer;
begin
Result := True;
@ -1957,14 +1960,23 @@ begin
begin
if (TempRec.Name <> '.') and (TempRec.Name <> '..') then
begin
if DeleteDirContents(TempPath) then
if DeleteDirContents(TempPath, aExcludeFiles) then
Result := RemoveDir(TempPath) and Result
else
Result := False;
end;
end
else
Result := DeleteFile(TempPath) and Result;
if (aExcludeFiles <> nil) then
begin
TempIdx := aExcludeFiles.IndexOf(TempRec.Name);
Result := ((TempIdx >= 0) or
((TempIdx < 0) and DeleteFile(TempPath))) and
Result;
end
else
Result := DeleteFile(TempPath) and Result;
until (FindNext(TempRec) <> 0) or not(Result);
finally
FindClose(TempRec);
@ -1975,4 +1987,65 @@ begin
end;
end;
function DeleteFileList(const aFileList : TStringList) : boolean;
var
i, TempCount : integer;
begin
Result := False;
try
if (aFileList <> nil) then
begin
i := 0;
TempCount := 0;
while (i < aFileList.Count) do
begin
if FileExists(aFileList[i]) and DeleteFile(aFileList[i]) then inc(TempCount);
inc(i);
end;
Result := (aFileList.Count = TempCount);
end;
except
on e : exception do
if CustomExceptionHandler('DeleteFileList', e) then raise;
end;
end;
function MoveFileList(const aFileList : TStringList; const aSrcDirectory, aDstDirectory : string) : boolean;
var
i, TempCount : integer;
TempSrcPath, TempDstPath : string;
begin
Result := False;
try
if (aFileList <> nil) and
(length(aSrcDirectory) > 0) and
(length(aDstDirectory) > 0) and
DirectoryExists(aSrcDirectory) and
(DirectoryExists(aDstDirectory) or CreateDir(aDstDirectory)) then
begin
i := 0;
TempCount := 0;
while (i < aFileList.Count) do
begin
TempSrcPath := IncludeTrailingPathDelimiter(aSrcDirectory) + aFileList[i];
TempDstPath := IncludeTrailingPathDelimiter(aDstDirectory) + aFileList[i];
if FileExists(TempSrcPath) and RenameFile(TempSrcPath, TempDstPath) then inc(TempCount);
inc(i);
end;
Result := (aFileList.Count = TempCount);
end;
except
on e : exception do
if CustomExceptionHandler('MoveFileList', e) then raise;
end;
end;
end.

View File

@ -101,7 +101,7 @@ type
procedure RemoveReferences; override;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
@ -491,11 +491,11 @@ end;
// TCustomRenderHandler
constructor TCustomRenderHandler.Create(const events: Pointer);
constructor TCustomRenderHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
FEvents := events;
FEvents := Pointer(events);
end;
destructor TCustomRenderHandler.Destroy;

View File

@ -90,7 +90,7 @@ type
procedure InitializeVars;
public
constructor Create(const events: Pointer); reintroduce; virtual;
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
procedure BeforeDestruction; override;
procedure RemoveReferences; override;
end;
@ -457,14 +457,16 @@ end;
// TCustomRequestHandler
constructor TCustomRequestHandler.Create(const events: Pointer);
constructor TCustomRequestHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
InitializeVars;
FEvents := events;
FResourceRequestHandler := TCustomResourceRequestHandler.Create(FEvents);
FEvents := Pointer(events);
if (events <> nil) and events.MustCreateResourceRequestHandler then
FResourceRequestHandler := TCustomResourceRequestHandler.Create(events);
end;
procedure TCustomRequestHandler.BeforeDestruction;

View File

@ -102,7 +102,7 @@ type
procedure InitializeVars;
public
constructor Create(const events: Pointer); reintroduce;
constructor Create(const events : IChromiumEvents); reintroduce;
procedure BeforeDestruction; override;
procedure RemoveReferences; override;
end;
@ -534,14 +534,16 @@ end;
// TCustomResourceRequestHandler
constructor TCustomResourceRequestHandler.Create(const events: Pointer);
constructor TCustomResourceRequestHandler.Create(const events : IChromiumEvents);
begin
inherited Create;
InitializeVars;
FEvents := events;
FCookieAccessFilter := TCustomCookieAccessFilter.Create(FEvents);
FEvents := Pointer(events);
if (events <> nil) and events.MustCreateCookieAccessFilter then
FCookieAccessFilter := TCustomCookieAccessFilter.Create(events);
end;
procedure TCustomResourceRequestHandler.BeforeDestruction;

View File

@ -2,9 +2,9 @@
"UpdateLazPackages" : [
{
"ForceNotify" : false,
"InternalVersion" : 11,
"InternalVersion" : 12,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "75.0.7.0"
"Version" : "75.0.8.0"
}
],
"UpdatePackageData" : {