You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-12 22:07:39 +02:00
Update to CEF 83.4.0
This commit is contained in:
@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chro
|
||||
|
||||
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 83.3.12 which includes Chromium 83.0.4103.97.
|
||||
CEF4Delphi uses CEF 83.4.0 which includes Chromium 83.0.4103.106.
|
||||
The CEF binaries used by CEF4Delphi are available for download at spotify :
|
||||
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_83.3.12%2Bg0889ff0%2Bchromium-83.0.4103.97_windows32.tar.bz2)
|
||||
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_83.3.12%2Bg0889ff0%2Bchromium-83.0.4103.97_windows64.tar.bz2)
|
||||
* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_83.4.0%2Bgfd6631b%2Bchromium-83.0.4103.106_windows32.tar.bz2)
|
||||
* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_83.4.0%2Bgfd6631b%2Bchromium-83.0.4103.106_windows64.tar.bz2)
|
||||
|
||||
|
||||
CEF4Delphi was developed and tested on Delphi 10.4 and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2, Delphi 10.3 and Lazarus 2.0.8/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components.
|
||||
|
@ -183,7 +183,7 @@ uses
|
||||
// This method for sending text messages is limited to around 10000 characters
|
||||
// but it's much easier to implement than using a JavaScript extension.
|
||||
// It cosist of using the JavaScript command "console.log" with a known text
|
||||
// preamble. The browser process rceives the console message in the
|
||||
// preamble. The browser process receives the console message in the
|
||||
// TChromium.OnConsoleMessage event and we identify the right message thanks to
|
||||
// the preamble in the message.
|
||||
|
||||
@ -399,6 +399,18 @@ begin
|
||||
// Remove it if you don't want to use the DOM visitor
|
||||
GlobalCEFApp.LogFile := 'debug.log';
|
||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
||||
|
||||
// Delphi can only debug one process and it debugs the browser process by
|
||||
// default. If you need to debug code executed in the render process you will
|
||||
// need to use any of the methods described here :
|
||||
// https://www.briskbard.com/index.php?lang=en&pageid=cef#debugging
|
||||
|
||||
// Using the "Single process" mode is one of the ways to debug all the code
|
||||
// because everything is executed in the browser process and Delphi won't have
|
||||
// any problems. However, The "Single process" mode is unsupported by CEF and
|
||||
// it causes unexpected issues. You should *ONLY* use it for debugging
|
||||
// purposses.
|
||||
//GlobalCEFApp.SingleProcess := True;
|
||||
end;
|
||||
|
||||
procedure TDOMVisitorFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
|
@ -58,6 +58,7 @@ const
|
||||
MINIBROWSER_CONTEXTMENU_SETJSEVENT = MENU_ID_USER_FIRST + 1;
|
||||
MINIBROWSER_CONTEXTMENU_JSVISITDOM = MENU_ID_USER_FIRST + 2;
|
||||
MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS = MENU_ID_USER_FIRST + 3;
|
||||
MINIBROWSER_CONTEXTMENU_OFFLINE = MENU_ID_USER_FIRST + 4;
|
||||
|
||||
MOUSEOVER_MESSAGE_NAME = 'mouseover';
|
||||
CUSTOMNAME_MESSAGE_NAME = 'customname';
|
||||
@ -93,6 +94,8 @@ type
|
||||
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
|
||||
FClosing : boolean; // Set to True in the CloseQuery event.
|
||||
|
||||
FOffline : boolean;
|
||||
|
||||
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
|
||||
procedure ShowTextViewerMsg(var aMessage : TMessage); message MINIBROWSER_SHOWTEXTVIEWER;
|
||||
@ -100,6 +103,8 @@ type
|
||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||
|
||||
function SwitchOfflineMode : integer;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -112,7 +117,7 @@ implementation
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uSimpleTextViewer, uCEFMiscFunctions, uTestExtensionHandler;
|
||||
uSimpleTextViewer, uCEFMiscFunctions, uTestExtensionHandler, uCEFDictionaryValue;
|
||||
|
||||
// BASIC CONCEPTS
|
||||
// ==============
|
||||
@ -332,6 +337,8 @@ begin
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SETJSEVENT, 'Set mouseover event');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_JSVISITDOM, 'Visit DOM in JavaScript');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS, 'Show DevTools');
|
||||
model.AddCheckItem(MINIBROWSER_CONTEXTMENU_OFFLINE, 'Offline');
|
||||
model.SetChecked(MINIBROWSER_CONTEXTMENU_OFFLINE, FOffline);
|
||||
end;
|
||||
|
||||
procedure TJSExtensionFrm.Chromium1BeforePopup(Sender: TObject;
|
||||
@ -396,6 +403,29 @@ begin
|
||||
TempPoint.y := params.YCoord;
|
||||
Chromium1.ShowDevTools(TempPoint, nil);
|
||||
end;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_OFFLINE :
|
||||
SwitchOfflineMode;
|
||||
end;
|
||||
end;
|
||||
|
||||
// This is a simple example to set the "offline" mode in the DevTools using the TChromium methods directly.
|
||||
function TJSExtensionFrm.SwitchOfflineMode : integer;
|
||||
var
|
||||
TempParams : ICefDictionaryValue;
|
||||
begin
|
||||
try
|
||||
FOffline := not(FOffline);
|
||||
|
||||
TempParams := TCefDictionaryValueRef.New;
|
||||
TempParams.SetBool('offline', FOffline);
|
||||
TempParams.SetDouble('latency', 0);
|
||||
TempParams.SetDouble('downloadThroughput', 0);
|
||||
TempParams.SetDouble('uploadThroughput', 0);
|
||||
|
||||
Result := Chromium1.ExecuteDevToolsMethod(0, 'Network.emulateNetworkConditions', TempParams);
|
||||
finally
|
||||
TempParams := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -22,8 +22,8 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="462"/>
|
||||
<CursorPos Y="485"/>
|
||||
<TopLine Value="120"/>
|
||||
<CursorPos X="83" Y="140"/>
|
||||
<UsageCount Value="20"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -52,124 +52,124 @@
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="uTestExtensionHandler.pas"/>
|
||||
<Caret Line="94" Column="56" TopLine="41"/>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="136" Column="39" TopLine="127"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="312" Column="54" TopLine="301"/>
|
||||
<Caret Line="144" Column="114" TopLine="127"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="JSExtension.lpr"/>
|
||||
<Caret Line="60" Column="17" TopLine="42"/>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="150" Column="74" TopLine="127"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="126" TopLine="111"/>
|
||||
<Caret Line="199" Column="41" TopLine="173"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="136" Column="39" TopLine="127"/>
|
||||
<Caret Line="201" Column="92" TopLine="173"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="144" Column="114" TopLine="127"/>
|
||||
<Caret Line="205" Column="77" TopLine="173"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="150" Column="74" TopLine="127"/>
|
||||
<Caret Line="207" Column="18" TopLine="173"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="199" Column="41" TopLine="173"/>
|
||||
<Caret Line="31" Column="76"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="201" Column="92" TopLine="173"/>
|
||||
<Caret Line="149" Column="96" TopLine="108"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="205" Column="77" TopLine="173"/>
|
||||
<Caret Line="150" Column="73" TopLine="127"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="207" Column="18" TopLine="173"/>
|
||||
<Caret Line="199" Column="40" TopLine="173"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="31" Column="76"/>
|
||||
<Caret Line="201" Column="91" TopLine="173"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="149" Column="96" TopLine="108"/>
|
||||
<Caret Line="205" Column="75" TopLine="173"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="150" Column="73" TopLine="127"/>
|
||||
<Caret Line="61" Column="30" TopLine="47"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="199" Column="40" TopLine="173"/>
|
||||
<Caret Line="322" TopLine="303"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="201" Column="91" TopLine="173"/>
|
||||
<Caret Line="324" TopLine="305"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="205" Column="75" TopLine="173"/>
|
||||
<Caret Line="486" Column="3" TopLine="483"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="61" Column="30" TopLine="47"/>
|
||||
<Caret Line="108" Column="15" TopLine="82"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="322" TopLine="303"/>
|
||||
<Caret Line="343" TopLine="339"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="324" TopLine="305"/>
|
||||
<Caret Line="486" Column="40" TopLine="483"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="486" Column="3" TopLine="483"/>
|
||||
<Caret Line="108" Column="31" TopLine="81"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="108" Column="15" TopLine="82"/>
|
||||
<Caret Line="343" Column="22" TopLine="339"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="343" TopLine="339"/>
|
||||
<Caret Line="286" Column="56" TopLine="274"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="486" Column="40" TopLine="483"/>
|
||||
<Caret Line="285" Column="56" TopLine="273"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="108" Column="31" TopLine="81"/>
|
||||
<Caret Line="295" Column="9" TopLine="273"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="343" Column="22" TopLine="339"/>
|
||||
<Caret Line="343" Column="41" TopLine="324"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="286" Column="56" TopLine="274"/>
|
||||
<Caret Line="62" Column="35" TopLine="46"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="285" Column="56" TopLine="273"/>
|
||||
<Caret Line="359" Column="65" TopLine="340"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="295" Column="9" TopLine="273"/>
|
||||
<Caret Line="419" Column="88" TopLine="403"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uJSExtension.pas"/>
|
||||
<Caret Line="343" Column="41" TopLine="324"/>
|
||||
<Caret Line="125" Column="42" TopLine="88"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
|
@ -14,7 +14,7 @@ object JSExtensionFrm: TJSExtensionFrm
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.0.6.0'
|
||||
LCLVersion = '2.0.8.0'
|
||||
object NavControlPnl: TPanel
|
||||
Left = 0
|
||||
Height = 21
|
||||
|
@ -59,7 +59,8 @@ const
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_SETJSEVENT = MENU_ID_USER_FIRST + 1;
|
||||
MINIBROWSER_CONTEXTMENU_JSVISITDOM = MENU_ID_USER_FIRST + 2;
|
||||
MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS = MENU_ID_USER_FIRST + 3;
|
||||
MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS = MENU_ID_USER_FIRST + 3;
|
||||
MINIBROWSER_CONTEXTMENU_OFFLINE = MENU_ID_USER_FIRST + 4;
|
||||
|
||||
MOUSEOVER_MESSAGE_NAME = 'mouseover';
|
||||
CUSTOMNAME_MESSAGE_NAME = 'customname';
|
||||
@ -110,6 +111,8 @@ type
|
||||
// Variables to control when can we destroy the form safely
|
||||
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
|
||||
FClosing : boolean; // Set to True in the CloseQuery event.
|
||||
|
||||
FOffline : boolean;
|
||||
|
||||
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
|
||||
@ -118,6 +121,8 @@ type
|
||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||
|
||||
function SwitchOfflineMode : integer;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
@ -132,7 +137,7 @@ implementation
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
uSimpleTextViewer, uCEFMiscFunctions, uTestExtensionHandler;
|
||||
uSimpleTextViewer, uCEFMiscFunctions, uTestExtensionHandler, uCEFDictionaryValue;
|
||||
|
||||
// BASIC CONCEPTS
|
||||
// ==============
|
||||
@ -351,7 +356,9 @@ begin
|
||||
model.AddSeparator;
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SETJSEVENT, 'Set mouseover event');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_JSVISITDOM, 'Visit DOM in JavaScript');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS, 'Show DevTools');
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS, 'Show DevTools');
|
||||
model.AddCheckItem(MINIBROWSER_CONTEXTMENU_OFFLINE, 'Offline');
|
||||
model.SetChecked(MINIBROWSER_CONTEXTMENU_OFFLINE, FOffline);
|
||||
end;
|
||||
|
||||
procedure TJSExtensionFrm.Chromium1BeforePopup(Sender: TObject;
|
||||
@ -417,7 +424,30 @@ begin
|
||||
TempPoint.x := params.XCoord;
|
||||
TempPoint.y := params.YCoord;
|
||||
Chromium1.ShowDevTools(TempPoint, nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_OFFLINE :
|
||||
SwitchOfflineMode;
|
||||
end;
|
||||
end;
|
||||
|
||||
// This is a simple example to set the "offline" mode in the DevTools using the TChromium methods directly.
|
||||
function TJSExtensionFrm.SwitchOfflineMode : integer;
|
||||
var
|
||||
TempParams : ICefDictionaryValue;
|
||||
begin
|
||||
try
|
||||
FOffline := not(FOffline);
|
||||
|
||||
TempParams := TCefDictionaryValueRef.New;
|
||||
TempParams.SetBool('offline', FOffline);
|
||||
TempParams.SetDouble('latency', 0);
|
||||
TempParams.SetDouble('downloadThroughput', 0);
|
||||
TempParams.SetDouble('uploadThroughput', 0);
|
||||
|
||||
Result := Chromium1.ExecuteDevToolsMethod(0, 'Network.emulateNetworkConditions', TempParams);
|
||||
finally
|
||||
TempParams := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -4,14 +4,13 @@
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="22">
|
||||
<Units Count="32">
|
||||
<Unit0>
|
||||
<Filename Value="MiniBrowser.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="37"/>
|
||||
<CursorPos X="3" Y="51"/>
|
||||
<UsageCount Value="22"/>
|
||||
<CursorPos X="50" Y="51"/>
|
||||
<UsageCount Value="27"/>
|
||||
<Loaded Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit0>
|
||||
@ -21,15 +20,11 @@
|
||||
<ComponentName Value="MiniBrowserFrm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="509"/>
|
||||
<CursorPos X="48" Y="543"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 Y="842" ID="1"/>
|
||||
<Item1 X="49" Y="61" ID="2"/>
|
||||
<Item2 X="65" Y="1073" ID="3"/>
|
||||
</Bookmarks>
|
||||
<TopLine Value="293"/>
|
||||
<CursorPos X="66" Y="310"/>
|
||||
<UsageCount Value="27"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
@ -43,7 +38,7 @@
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="69"/>
|
||||
<CursorPos X="86" Y="70"/>
|
||||
<UsageCount Value="22"/>
|
||||
<UsageCount Value="27"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
@ -53,7 +48,7 @@
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<UsageCount Value="22"/>
|
||||
<UsageCount Value="27"/>
|
||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
@ -82,14 +77,15 @@
|
||||
<Filename Value="..\..\..\source\uCEFApplication.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="43"/>
|
||||
<UsageCount Value="10"/>
|
||||
<CursorPos X="42" Y="52"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="..\..\..\source\uCEFTypes.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="280"/>
|
||||
<CursorPos X="51" Y="290"/>
|
||||
<UsageCount Value="10"/>
|
||||
<TopLine Value="295"/>
|
||||
<CursorPos X="57" Y="322"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="..\..\..\source\uCEFInterfaces.pas"/>
|
||||
@ -181,48 +177,87 @@
|
||||
<CursorPos X="47" Y="219"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<Filename Value="..\..\..\source\uCEFApplicationCore.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="900"/>
|
||||
<CursorPos X="77" Y="945"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<Filename Value="..\..\..\source\uCEFMiscFunctions.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="218"/>
|
||||
<CursorPos X="10" Y="229"/>
|
||||
<UsageCount Value="12"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 X="9" Y="1299" ID="1"/>
|
||||
<Item1 X="26" Y="896" ID="2"/>
|
||||
<Item2 X="7" Y="1355" ID="3"/>
|
||||
</Bookmarks>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\inc\systemh.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="424"/>
|
||||
<CursorPos X="29" Y="413"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit24>
|
||||
<Unit25>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\objpas\sysutils\filutilh.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="118"/>
|
||||
<CursorPos X="10" Y="130"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\objpas\sysutils\sysutilh.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="235"/>
|
||||
<CursorPos X="13" Y="246"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit26>
|
||||
<Unit27>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\ascdef.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="61"/>
|
||||
<CursorPos X="10" Y="70"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit27>
|
||||
<Unit28>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\inc\dynlibs.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="136"/>
|
||||
<CursorPos X="3" Y="149"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit28>
|
||||
<Unit29>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\dynlibs.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="31"/>
|
||||
<CursorPos X="41" Y="45"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit29>
|
||||
<Unit30>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\redef.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="894"/>
|
||||
<CursorPos X="10" Y="906"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit30>
|
||||
<Unit31>
|
||||
<Filename Value="C:\lazarus\fpc\3.0.4\source\rtl\win\wininc\unifun.inc"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="59"/>
|
||||
<CursorPos X="10" Y="70"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit31>
|
||||
</Units>
|
||||
<JumpHistory Count="10" HistoryIndex="9">
|
||||
<JumpHistory Count="1">
|
||||
<Position1>
|
||||
<Filename Value="MiniBrowser.lpr"/>
|
||||
<Caret Line="65" TopLine="46"/>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="305" TopLine="293"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="66" Column="75" TopLine="46"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="67" Column="39" TopLine="46"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="461" TopLine="448"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="48" Column="37" TopLine="22"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="310" Column="52" TopLine="295"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1005" Column="88" TopLine="979"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1037" Column="50" TopLine="996"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="1157" Column="62" TopLine="1129"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uMiniBrowser.pas"/>
|
||||
<Caret Line="214" Column="29" TopLine="191"/>
|
||||
</Position10>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -302,7 +302,6 @@ begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.LogFile := 'debug.log';
|
||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
||||
GlobalCEFApp.cache := 'cache';
|
||||
GlobalCEFApp.EnablePrintPreview := True;
|
||||
end;
|
||||
|
||||
|
@ -214,7 +214,8 @@ contains
|
||||
uCEFButtonComponent in '..\source\uCEFButtonComponent.pas',
|
||||
uCEFLabelButtonComponent in '..\source\uCEFLabelButtonComponent.pas',
|
||||
uCEFMenuButtonComponent in '..\source\uCEFMenuButtonComponent.pas',
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas';
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas',
|
||||
uCEFDevToolsMessageObserver in '..\source\uCEFDevToolsMessageObserver.pas';
|
||||
|
||||
end.
|
||||
|
||||
|
@ -211,6 +211,7 @@ contains
|
||||
uCEFButtonComponent in '..\source\uCEFButtonComponent.pas',
|
||||
uCEFLabelButtonComponent in '..\source\uCEFLabelButtonComponent.pas',
|
||||
uCEFMenuButtonComponent in '..\source\uCEFMenuButtonComponent.pas',
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas';
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas',
|
||||
uCEFDevToolsMessageObserver in '..\source\uCEFDevToolsMessageObserver.pas';
|
||||
|
||||
end.
|
||||
|
@ -219,7 +219,8 @@ contains
|
||||
uCEFButtonComponent in '..\source\uCEFButtonComponent.pas',
|
||||
uCEFLabelButtonComponent in '..\source\uCEFLabelButtonComponent.pas',
|
||||
uCEFMenuButtonComponent in '..\source\uCEFMenuButtonComponent.pas',
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas';
|
||||
uCEFAudioHandler in '..\source\uCEFAudioHandler.pas',
|
||||
uCEFDevToolsMessageObserver in '..\source\uCEFDevToolsMessageObserver.pas';
|
||||
|
||||
end.
|
||||
|
||||
|
@ -335,6 +335,7 @@
|
||||
<DCCReference Include="..\source\uCEFLabelButtonComponent.pas"/>
|
||||
<DCCReference Include="..\source\uCEFMenuButtonComponent.pas"/>
|
||||
<DCCReference Include="..\source\uCEFAudioHandler.pas"/>
|
||||
<DCCReference Include="..\source\uCEFDevToolsMessageObserver.pas"/>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
|
@ -21,8 +21,8 @@
|
||||
</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="83" Minor="3" Release="12"/>
|
||||
<Files Count="186">
|
||||
<Version Major="83" Minor="4"/>
|
||||
<Files Count="187">
|
||||
<Item1>
|
||||
<Filename Value="..\source\uCEFAccessibilityHandler.pas"/>
|
||||
<UnitName Value="uCEFAccessibilityHandler"/>
|
||||
@ -783,6 +783,10 @@
|
||||
<Filename Value="..\source\uCEFAudioHandler.pas"/>
|
||||
<UnitName Value="uCEFAudioHandler"/>
|
||||
</Item186>
|
||||
<Item187>
|
||||
<Filename Value="..\source\uCEFDevToolsMessageObserver.pas"/>
|
||||
<UnitName Value="uCEFDevToolsMessageObserver"/>
|
||||
</Item187>
|
||||
</Files>
|
||||
<RequiredPkgs Count="4">
|
||||
<Item1>
|
||||
|
@ -61,7 +61,8 @@ uses
|
||||
uCEFMenuButtonComponent, uCEFLabelButtonComponent, uCEFButtonComponent,
|
||||
uCEFBrowserViewComponent, uCEFWindowComponent, uCEFPanelComponent,
|
||||
uCEFScrollViewComponent, uCEFTextfieldComponent, uCEFViewComponent,
|
||||
uCEFViewsFrameworkEvents, uCEFAudioHandler, LazarusPackageIntf;
|
||||
uCEFViewsFrameworkEvents, uCEFAudioHandler, uCEFDevToolsMessageObserver,
|
||||
LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -61,14 +61,14 @@ uses
|
||||
|
||||
const
|
||||
CEF_SUPPORTED_VERSION_MAJOR = 83;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 3;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 12;
|
||||
CEF_SUPPORTED_VERSION_MINOR = 4;
|
||||
CEF_SUPPORTED_VERSION_RELEASE = 0;
|
||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||
|
||||
CEF_CHROMEELF_VERSION_MAJOR = 83;
|
||||
CEF_CHROMEELF_VERSION_MINOR = 0;
|
||||
CEF_CHROMEELF_VERSION_RELEASE = 4103;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 97;
|
||||
CEF_CHROMEELF_VERSION_BUILD = 106;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
LIBCEF_DLL = 'libcef.dll';
|
||||
@ -169,6 +169,7 @@ type
|
||||
FAllowRunningInsecureContent : boolean;
|
||||
FSupportedSchemes : TStringList;
|
||||
FDisableNewBrowserInfoTimeout : boolean;
|
||||
FDevToolsProtocolLogFile : ustring;
|
||||
|
||||
FPluginPolicy : TCefPluginPolicySwitch;
|
||||
FDefaultEncoding : string;
|
||||
@ -440,6 +441,7 @@ type
|
||||
property DisableReadingFromCanvas : boolean read FDisableReadingFromCanvas write FDisableReadingFromCanvas; // --disable-reading-from-canvas
|
||||
property HyperlinkAuditing : boolean read FHyperlinkAuditing write FHyperlinkAuditing; // --no-pings
|
||||
property DisableNewBrowserInfoTimeout : boolean read FDisableNewBrowserInfoTimeout write FDisableNewBrowserInfoTimeout; // --disable-new-browser-info-timeout
|
||||
property DevToolsProtocolLogFile : ustring read FDevToolsProtocolLogFile write FDevToolsProtocolLogFile; // --devtools-protocol-log-file
|
||||
|
||||
// Properties used during the CEF initialization
|
||||
property WindowsSandboxInfo : Pointer read FWindowsSandboxInfo write FWindowsSandboxInfo;
|
||||
@ -674,6 +676,7 @@ begin
|
||||
FForceFieldTrialParams := '';
|
||||
FSupportedSchemes := nil;
|
||||
FDisableNewBrowserInfoTimeout := False;
|
||||
FDevToolsProtocolLogFile := '';
|
||||
|
||||
FDisableJavascriptCloseWindows := False;
|
||||
FDisableJavascriptAccessClipboard := False;
|
||||
@ -1709,6 +1712,9 @@ begin
|
||||
if FDisableNewBrowserInfoTimeout then
|
||||
commandLine.AppendSwitch('--disable-new-browser-info-timeout');
|
||||
|
||||
if (length(FDevToolsProtocolLogFile) > 0) then
|
||||
commandLine.AppendSwitchWithValue('--devtools-protocol-log-file', FDevToolsProtocolLogFile);
|
||||
|
||||
case FPluginPolicy of
|
||||
PLUGIN_POLICY_SWITCH_DETECT : commandLine.AppendSwitchWithValue('--plugin-policy', 'detect');
|
||||
PLUGIN_POLICY_SWITCH_BLOCK : commandLine.AppendSwitchWithValue('--plugin-policy', 'block');
|
||||
@ -2250,6 +2256,7 @@ begin
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_uriencode{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_uriencode');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_uridecode{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_uridecode');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_parse_json{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_parse_json');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_parse_json_buffer{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_parse_json_buffer');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_parse_jsonand_return_error{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_parse_jsonand_return_error');
|
||||
{$IFDEF FPC}Pointer({$ENDIF}cef_write_json{$IFDEF FPC}){$ENDIF} := GetProcAddress(FLibHandle, 'cef_write_json');
|
||||
|
||||
@ -2263,6 +2270,7 @@ begin
|
||||
assigned(cef_uriencode) and
|
||||
assigned(cef_uridecode) and
|
||||
assigned(cef_parse_json) and
|
||||
assigned(cef_parse_json_buffer) and
|
||||
assigned(cef_parse_jsonand_return_error) and
|
||||
assigned(cef_write_json);
|
||||
end;
|
||||
|
@ -109,6 +109,9 @@ type
|
||||
procedure ShowDevTools(const windowInfo: PCefWindowInfo; const client: ICefClient; const settings: PCefBrowserSettings; inspectElementAt: PCefPoint);
|
||||
procedure CloseDevTools;
|
||||
function HasDevTools: Boolean;
|
||||
function SendDevToolsMessage(const message_: ustring): boolean;
|
||||
function ExecuteDevToolsMethod(message_id: integer; const method: ustring; const params: ICefDictionaryValue): Integer;
|
||||
function AddDevToolsMessageObserver(const observer: ICefDevToolsMessageObserver): ICefRegistration;
|
||||
procedure GetNavigationEntries(const visitor: ICefNavigationEntryVisitor; currentOnly: Boolean);
|
||||
procedure GetNavigationEntriesProc(const proc: TCefNavigationEntryVisitorProc; currentOnly: Boolean);
|
||||
procedure SetMouseCursorChangeDisabled(disabled: Boolean);
|
||||
@ -158,7 +161,7 @@ implementation
|
||||
uses
|
||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFDownloadImageCallBack, uCEFFrame, uCEFPDFPrintCallback,
|
||||
uCEFRunFileDialogCallback, uCEFRequestContext, uCEFNavigationEntryVisitor, uCEFNavigationEntry,
|
||||
uCEFExtension, uCEFStringList;
|
||||
uCEFExtension, uCEFStringList, uCEFRegistration;
|
||||
|
||||
|
||||
// TCefBrowserRef
|
||||
@ -659,6 +662,35 @@ begin
|
||||
Result := PCefBrowserHost(FData)^.has_dev_tools(PCefBrowserHost(FData)) <> 0;
|
||||
end;
|
||||
|
||||
function TCefBrowserHostRef.SendDevToolsMessage(const message_: ustring): boolean;
|
||||
var
|
||||
TempMsg : TCefStringUtf8;
|
||||
TempLen : integer;
|
||||
begin
|
||||
TempMsg.str := nil;
|
||||
TempMsg.length := 0;
|
||||
TempMsg.dtor := nil;
|
||||
|
||||
TempLen := length(message_);
|
||||
Result := (TempLen > 0) and
|
||||
(cef_string_wide_to_utf8(PWideChar(@message_[1]), TempLen, @TempMsg) <> 0) and
|
||||
(PCefBrowserHost(FData)^.send_dev_tools_message(PCefBrowserHost(FData), TempMsg.str, TempMsg.length) <> 0);
|
||||
end;
|
||||
|
||||
function TCefBrowserHostRef.ExecuteDevToolsMethod(message_id: integer; const method: ustring; const params: ICefDictionaryValue): Integer;
|
||||
var
|
||||
TempMethod : TCefString;
|
||||
begin
|
||||
TempMethod := CefString(method);
|
||||
Result := PCefBrowserHost(FData)^.execute_dev_tools_method(PCefBrowserHost(FData), message_id, @TempMethod, CefGetData(params));
|
||||
end;
|
||||
|
||||
function TCefBrowserHostRef.AddDevToolsMessageObserver(const observer: ICefDevToolsMessageObserver): ICefRegistration;
|
||||
begin
|
||||
Result := TCefRegistrationRef.UnWrap(PCefBrowserHost(FData)^.add_dev_tools_message_observer(PCefBrowserHost(FData),
|
||||
CefGetData(observer)));
|
||||
end;
|
||||
|
||||
function TCefBrowserHostRef.HasView: Boolean;
|
||||
begin
|
||||
Result := PCefBrowserHost(FData)^.has_view(PCefBrowserHost(FData)) <> 0;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -110,15 +110,16 @@ type
|
||||
|
||||
// ICefRequestHandler
|
||||
TOnBeforeBrowse = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; user_gesture, isRedirect: Boolean; out Result: Boolean) of object;
|
||||
TOnOpenUrlFromTab = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean) of Object;
|
||||
TOnOpenUrlFromTab = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean) of object;
|
||||
TOnGetAuthCredentials = procedure(Sender: TObject; const browser: ICefBrowser; const originUrl: ustring; isProxy: Boolean; const host: ustring; port: Integer; const realm, scheme: ustring; const callback: ICefAuthCallback; out Result: Boolean) of object;
|
||||
TOnQuotaRequest = procedure(Sender: TObject; const browser: ICefBrowser; const originUrl: ustring; newSize: Int64; const callback: ICefRequestCallback; out Result: Boolean) of object;
|
||||
TOnCertificateError = procedure(Sender: TObject; const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefRequestCallback; out Result: Boolean) of Object;
|
||||
TOnCertificateError = procedure(Sender: TObject; const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefRequestCallback; out Result: Boolean) of object;
|
||||
TOnSelectClientCertificate = procedure(Sender: TObject; const browser: ICefBrowser; isProxy: boolean; const host: ustring; port: integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult : boolean) of object;
|
||||
TOnPluginCrashed = procedure(Sender: TObject; const browser: ICefBrowser; const pluginPath: ustring) of object;
|
||||
TOnRenderViewReady = procedure(Sender: Tobject; const browser: ICefBrowser) of Object;
|
||||
TOnRenderViewReady = procedure(Sender: Tobject; const browser: ICefBrowser) of object;
|
||||
TOnRenderProcessTerminated = procedure(Sender: TObject; const browser: ICefBrowser; status: TCefTerminationStatus) of object;
|
||||
TOnGetResourceRequestHandler = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean; const request_initiator: ustring; var disable_default_handling: boolean; var aExternalResourceRequestHandler : ICefResourceRequestHandler) of object;
|
||||
TOnDocumentAvailableInMainFrame = procedure(Sender: Tobject; const browser: ICefBrowser) of object;
|
||||
|
||||
// ICefResourceRequestHandler
|
||||
TOnBeforeResourceLoad = procedure(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefRequestCallback; out Result: TCefReturnValue) of object;
|
||||
@ -179,6 +180,13 @@ type
|
||||
TOnAudioStreamStoppedEvent = procedure(Sender: TObject; const browser: ICefBrowser) of object;
|
||||
TOnAudioStreamErrorEvent = procedure(Sender: TObject; const browser: ICefBrowser; const message_: ustring) of object;
|
||||
|
||||
// ICefDevToolsMessageObserver
|
||||
TOnDevToolsMessageEvent = procedure(Sender: TObject; const browser: ICefBrowser; const message_: ICefValue; var aHandled: boolean) of object;
|
||||
TOnDevToolsMethodResultEvent = procedure(Sender: TObject; const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue) of object;
|
||||
TOnDevToolsEventEvent = procedure(Sender: TObject; const method: ustring; const params: ICefValue) of object;
|
||||
TOnDevToolsAgentAttachedEvent = procedure(Sender: TObject; const browser: ICefBrowser) of object;
|
||||
TOnDevToolsAgentDetachedEvent = procedure(Sender: TObject; const browser: ICefBrowser) of object;
|
||||
|
||||
// Custom
|
||||
TOnTextResultAvailableEvent = procedure(Sender: TObject; const aText : ustring) of object;
|
||||
TOnPdfPrintFinishedEvent = procedure(Sender: TObject; aResultOK : boolean) of object;
|
||||
|
313
source/uCEFDevToolsMessageObserver.pas
Normal file
313
source/uCEFDevToolsMessageObserver.pas
Normal file
@ -0,0 +1,313 @@
|
||||
// ************************************************************************
|
||||
// ***************************** CEF4Delphi *******************************
|
||||
// ************************************************************************
|
||||
//
|
||||
// CEF4Delphi is based on DCEF3 which uses CEF to embed a chromium-based
|
||||
// browser in Delphi applications.
|
||||
//
|
||||
// The original license of DCEF3 still applies to CEF4Delphi.
|
||||
//
|
||||
// For more information about CEF4Delphi visit :
|
||||
// https://www.briskbard.com/index.php?lang=en&pageid=cef
|
||||
//
|
||||
// Copyright � 2020 Salvador Diaz Fau. All rights reserved.
|
||||
//
|
||||
// ************************************************************************
|
||||
// ************ vvvv Original license and comments below vvvv *************
|
||||
// ************************************************************************
|
||||
(*
|
||||
* Delphi Chromium Embedded 3
|
||||
*
|
||||
* Usage allowed under the restrictions of the Lesser GNU General Public License
|
||||
* or alternatively the restrictions of the Mozilla Public License 1.1
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
*
|
||||
* Unit owner : Henri Gourvest <hgourvest@gmail.com>
|
||||
* Web site : http://www.progdigy.com
|
||||
* Repository : http://code.google.com/p/delphichromiumembedded/
|
||||
* Group : http://groups.google.com/group/delphichromiumembedded
|
||||
*
|
||||
* Embarcadero Technologies, Inc is not permitted to use or redistribute
|
||||
* this source code without explicit permission.
|
||||
*
|
||||
*)
|
||||
|
||||
unit uCEFDevToolsMessageObserver;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE OBJFPC}{$H+}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFNDEF CPUX64}{$ALIGN ON}{$ENDIF}
|
||||
{$MINENUMSIZE 4}
|
||||
|
||||
{$I cef.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
|
||||
|
||||
type
|
||||
TCEFDevToolsMessageObserverOwn = class(TCefBaseRefCountedOwn, ICefDevToolsMessageObserver)
|
||||
protected
|
||||
procedure OnDevToolsMessage(const browser: ICefBrowser; const message_: ICefValue; var aHandled: boolean); virtual;
|
||||
procedure OnDevToolsMethodResult(const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue); virtual;
|
||||
procedure OnDevToolsEvent(const method: ustring; const params: ICefValue); virtual;
|
||||
procedure OnDevToolsAgentAttached(const browser: ICefBrowser); virtual;
|
||||
procedure OnDevToolsAgentDetached(const browser: ICefBrowser); virtual;
|
||||
|
||||
public
|
||||
constructor Create; virtual;
|
||||
end;
|
||||
|
||||
TCustomDevToolsMessageObserver = class(TCEFDevToolsMessageObserverOwn)
|
||||
protected
|
||||
FEvents : Pointer;
|
||||
|
||||
procedure OnDevToolsMessage(const browser: ICefBrowser; const message_: ICefValue; var aHandled: boolean); override;
|
||||
procedure OnDevToolsMethodResult(const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue); override;
|
||||
procedure OnDevToolsEvent(const method: ustring; const params: ICefValue); override;
|
||||
procedure OnDevToolsAgentAttached(const browser: ICefBrowser); override;
|
||||
procedure OnDevToolsAgentDetached(const browser: ICefBrowser); override;
|
||||
|
||||
public
|
||||
constructor Create(const events: IChromiumEvents); reintroduce;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
{$IFDEF DELPHI16_UP}
|
||||
System.SysUtils,
|
||||
{$ELSE}
|
||||
SysUtils,
|
||||
{$ENDIF}
|
||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser;
|
||||
|
||||
|
||||
// ************************************************************
|
||||
// ************** TCEFDevToolsMessageObserverOwn **************
|
||||
// ************************************************************
|
||||
|
||||
function cef_on_dev_tools_message( self : PCefDevToolsMessageObserver;
|
||||
browser : PCefBrowser;
|
||||
const message_ : Pointer;
|
||||
message_size : NativeUInt): Integer; stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
TempHandled : boolean;
|
||||
TempValue : ICefValue;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
TempHandled := False;
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
|
||||
try
|
||||
TempValue := CefParseJson(message_, message_size);
|
||||
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsMessage(TCefBrowserRef.UnWrap(browser),
|
||||
TempValue,
|
||||
TempHandled);
|
||||
finally
|
||||
TempValue := nil;
|
||||
end;
|
||||
|
||||
Result := ord(TempHandled);
|
||||
end;
|
||||
|
||||
procedure cef_on_dev_tools_method_result( self : PCefDevToolsMessageObserver;
|
||||
browser : PCefBrowser;
|
||||
message_id : Integer;
|
||||
success : Integer;
|
||||
const result : Pointer;
|
||||
result_size : NativeUInt); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
TempValue : ICefValue;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
|
||||
try
|
||||
TempValue := CefParseJson(result, result_size);
|
||||
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsMethodResult(TCefBrowserRef.UnWrap(browser),
|
||||
message_id,
|
||||
success <> 0,
|
||||
TempValue);
|
||||
finally
|
||||
TempValue := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure cef_on_dev_tools_event( self : PCefDevToolsMessageObserver;
|
||||
const method : PCefString;
|
||||
const params : Pointer;
|
||||
params_size : NativeUInt); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
TempValue : ICefValue;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
|
||||
try
|
||||
TempValue := CefParseJson(params, params_size);
|
||||
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsEvent(CefString(method),
|
||||
TempValue);
|
||||
finally
|
||||
TempValue := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure cef_on_dev_tools_agent_attached(self : PCefDevToolsMessageObserver;
|
||||
browser : PCefBrowser); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
|
||||
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsAgentAttached(TCefBrowserRef.UnWrap(browser));
|
||||
end;
|
||||
|
||||
procedure cef_on_dev_tools_agent_detached(self : PCefDevToolsMessageObserver;
|
||||
browser : PCefBrowser); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCEFDevToolsMessageObserverOwn) then
|
||||
TCEFDevToolsMessageObserverOwn(TempObject).OnDevToolsAgentDetached(TCefBrowserRef.UnWrap(browser));
|
||||
end;
|
||||
|
||||
constructor TCEFDevToolsMessageObserverOwn.Create;
|
||||
begin
|
||||
inherited CreateData(SizeOf(TCefDevToolsMessageObserver));
|
||||
|
||||
with PCefDevToolsMessageObserver(FData)^ do
|
||||
begin
|
||||
on_dev_tools_message := {$IFDEF FPC}@{$ENDIF}cef_on_dev_tools_message;
|
||||
on_dev_tools_method_result := {$IFDEF FPC}@{$ENDIF}cef_on_dev_tools_method_result;
|
||||
on_dev_tools_event := {$IFDEF FPC}@{$ENDIF}cef_on_dev_tools_event;
|
||||
on_dev_tools_agent_attached := {$IFDEF FPC}@{$ENDIF}cef_on_dev_tools_agent_attached;
|
||||
on_dev_tools_agent_detached := {$IFDEF FPC}@{$ENDIF}cef_on_dev_tools_agent_detached;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEFDevToolsMessageObserverOwn.OnDevToolsMessage(const browser : ICefBrowser;
|
||||
const message_ : ICefValue;
|
||||
var aHandled : boolean);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCEFDevToolsMessageObserverOwn.OnDevToolsMethodResult(const browser : ICefBrowser;
|
||||
message_id : integer;
|
||||
success : boolean;
|
||||
const result : ICefValue);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCEFDevToolsMessageObserverOwn.OnDevToolsEvent(const method : ustring;
|
||||
const params : ICefValue);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCEFDevToolsMessageObserverOwn.OnDevToolsAgentAttached(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCEFDevToolsMessageObserverOwn.OnDevToolsAgentDetached(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
|
||||
// ************************************************************
|
||||
// ************** TCustomDevToolsMessageObserver **************
|
||||
// ************************************************************
|
||||
|
||||
constructor TCustomDevToolsMessageObserver.Create(const events: IChromiumEvents);
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
FEvents := Pointer(events);
|
||||
end;
|
||||
|
||||
destructor TCustomDevToolsMessageObserver.Destroy;
|
||||
begin
|
||||
FEvents := nil;
|
||||
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TCustomDevToolsMessageObserver.OnDevToolsMessage(const browser : ICefBrowser;
|
||||
const message_ : ICefValue;
|
||||
var aHandled : boolean);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDevToolsMessage(browser, message_, aHandled);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomDevToolsMessageObserver.OnDevToolsMessage', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomDevToolsMessageObserver.OnDevToolsMethodResult(const browser : ICefBrowser;
|
||||
message_id : integer;
|
||||
success : boolean;
|
||||
const result : ICefValue);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDevToolsMethodResult(browser, message_id, success, result);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomDevToolsMessageObserver.OnDevToolsMethodResult', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomDevToolsMessageObserver.OnDevToolsEvent(const method : ustring;
|
||||
const params : ICefValue);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDevToolsEvent(method, params);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomDevToolsMessageObserver.OnDevToolsEvent', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomDevToolsMessageObserver.OnDevToolsAgentAttached(const browser: ICefBrowser);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDevToolsAgentAttached(browser);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomDevToolsMessageObserver.OnDevToolsAgentAttached', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomDevToolsMessageObserver.OnDevToolsAgentDetached(const browser: ICefBrowser);
|
||||
begin
|
||||
try
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDevToolsAgentDetached(browser);
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCustomDevToolsMessageObserver.OnDevToolsAgentDetached', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
@ -151,6 +151,8 @@ type
|
||||
ICefMediaSink = interface;
|
||||
ICefMediaSource = interface;
|
||||
ICefAudioHandler = interface;
|
||||
ICefDevToolsMessageObserver = interface;
|
||||
ICefValue = interface;
|
||||
|
||||
TCefv8ValueArray = array of ICefv8Value;
|
||||
TCefX509CertificateArray = array of ICefX509Certificate;
|
||||
@ -369,6 +371,7 @@ type
|
||||
procedure doOnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
||||
procedure doOnRenderViewReady(const browser: ICefBrowser);
|
||||
procedure doOnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
procedure doOnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
|
||||
// ICefResourceRequestHandler
|
||||
function doOnBeforeResourceLoad(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefRequestCallback): TCefReturnValue;
|
||||
@ -429,6 +432,13 @@ type
|
||||
procedure doOnAudioStreamStopped(const browser: ICefBrowser);
|
||||
procedure doOnAudioStreamError(const browser: ICefBrowser; const message_: ustring);
|
||||
|
||||
// ICefDevToolsMessageObserver
|
||||
procedure doOnDevToolsMessage(const browser: ICefBrowser; const message_: ICefValue; var aHandled: boolean);
|
||||
procedure doOnDevToolsMethodResult(const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue);
|
||||
procedure doOnDevToolsEvent(const method: ustring; const params: ICefValue);
|
||||
procedure doOnDevToolsAgentAttached(const browser: ICefBrowser);
|
||||
procedure doOnDevToolsAgentDetached(const browser: ICefBrowser);
|
||||
|
||||
// Custom
|
||||
procedure doCookiesDeleted(numDeleted : integer);
|
||||
procedure doPdfPrintFinished(aResultOK : boolean);
|
||||
@ -571,6 +581,9 @@ type
|
||||
procedure ShowDevTools(const windowInfo: PCefWindowInfo; const client: ICefClient; const settings: PCefBrowserSettings; inspectElementAt: PCefPoint);
|
||||
procedure CloseDevTools;
|
||||
function HasDevTools: Boolean;
|
||||
function SendDevToolsMessage(const message_: ustring): boolean;
|
||||
function ExecuteDevToolsMethod(message_id: integer; const method: ustring; const params: ICefDictionaryValue): Integer;
|
||||
function AddDevToolsMessageObserver(const observer: ICefDevToolsMessageObserver): ICefRegistration;
|
||||
procedure GetNavigationEntries(const visitor: ICefNavigationEntryVisitor; currentOnly: Boolean);
|
||||
procedure GetNavigationEntriesProc(const proc: TCefNavigationEntryVisitorProc; currentOnly: Boolean);
|
||||
procedure SetMouseCursorChangeDisabled(disabled: Boolean);
|
||||
@ -1291,6 +1304,17 @@ type
|
||||
['{9226018F-7A56-4F2E-AF01-43268E33EE6B}']
|
||||
end;
|
||||
|
||||
// TCefDevToolsMessageObserver
|
||||
// /include/capi/cef_devtools_message_observer_capi.h (cef_dev_tools_message_observer_t)
|
||||
ICefDevToolsMessageObserver = interface(ICefBaseRefCounted)
|
||||
['{76E5BB2B-7F69-4BC9-94C7-B55C61CE630F}']
|
||||
procedure OnDevToolsMessage(const browser: ICefBrowser; const message_: ICefValue; var aHandled: boolean);
|
||||
procedure OnDevToolsMethodResult(const browser: ICefBrowser; message_id: integer; success: boolean; const result: ICefValue);
|
||||
procedure OnDevToolsEvent(const method: ustring; const params: ICefValue);
|
||||
procedure OnDevToolsAgentAttached(const browser: ICefBrowser);
|
||||
procedure OnDevToolsAgentDetached(const browser: ICefBrowser);
|
||||
end;
|
||||
|
||||
// TCefMediaRouter
|
||||
// /include/capi/cef_media_router_capi.h (cef_media_router_t)
|
||||
ICefMediaRouter = interface(ICefBaseRefCounted)
|
||||
@ -1844,6 +1868,7 @@ type
|
||||
procedure OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring);
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser);
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
procedure OnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
|
||||
procedure RemoveReferences; // custom procedure to clear all references
|
||||
end;
|
||||
|
@ -120,6 +120,7 @@ var
|
||||
cef_uriencode : function(const text: PCefString; use_plus: Integer): PCefStringUserFree; cdecl;
|
||||
cef_uridecode : function(const text: PCefString; convert_to_utf8: Integer; unescape_rule: TCefUriUnescapeRule): PCefStringUserFree; cdecl;
|
||||
cef_parse_json : function(const json_string: PCefString; options: TCefJsonParserOptions): PCefValue; cdecl;
|
||||
cef_parse_json_buffer : function(const json: Pointer; json_size: NativeUInt; options: TCefJsonParserOptions): PCefValue; cdecl;
|
||||
cef_parse_jsonand_return_error : function(const json_string: PCefString; options: TCefJsonParserOptions; error_code_out: PCefJsonParserError; error_msg_out: PCefString): PCefValue; cdecl;
|
||||
cef_write_json : function(node: PCefValue; options: TCefJsonWriterOptions): PCefStringUserFree; cdecl;
|
||||
|
||||
|
@ -245,7 +245,8 @@ function CefUriDecode(const text: ustring; convertToUtf8: Boolean; unescapeRule:
|
||||
|
||||
function CefGetPath(const aPathKey : TCefPathKey) : ustring;
|
||||
|
||||
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions): ICefValue;
|
||||
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions = JSON_PARSER_RFC): ICefValue; overload;
|
||||
function CefParseJson(const json: Pointer; json_size: NativeUInt; options: TCefJsonParserOptions = JSON_PARSER_RFC): ICefValue; overload;
|
||||
function CefParseJsonAndReturnError(const jsonString : ustring;
|
||||
options : TCefJsonParserOptions;
|
||||
out errorCodeOut : TCefJsonParserError;
|
||||
@ -434,6 +435,7 @@ begin
|
||||
cef_string_wide_to_utf16(PWideChar(str), Length(str), @Result);
|
||||
end;
|
||||
|
||||
|
||||
procedure _free_string(str: PChar16); stdcall;
|
||||
begin
|
||||
if (str <> nil) then FreeMem(str);
|
||||
@ -1712,6 +1714,7 @@ begin
|
||||
TempParts.origin := CefString(parts.origin);
|
||||
TempParts.path := CefString(parts.path);
|
||||
TempParts.query := CefString(parts.query);
|
||||
TempParts.fragment := CefString(parts.fragment);
|
||||
|
||||
CefStringInitialize(@TempURL);
|
||||
|
||||
@ -1815,6 +1818,14 @@ begin
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function CefParseJson(const json: Pointer; json_size: NativeUInt; options: TCefJsonParserOptions): ICefValue;
|
||||
begin
|
||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded and (json <> nil) and (json_size > 0) then
|
||||
Result := TCefValueRef.UnWrap(cef_parse_json_buffer(json, json_size, options))
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function CefParseJsonAndReturnError(const jsonString : ustring;
|
||||
options : TCefJsonParserOptions;
|
||||
out errorCodeOut : TCefJsonParserError;
|
||||
|
@ -64,6 +64,7 @@ type
|
||||
procedure OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring); virtual;
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser); virtual;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); virtual;
|
||||
procedure OnDocumentAvailableInMainFrame(const browser: ICefBrowser); virtual;
|
||||
|
||||
procedure RemoveReferences; virtual;
|
||||
|
||||
@ -85,6 +86,7 @@ type
|
||||
procedure OnPluginCrashed(const browser: ICefBrowser; const pluginPath: ustring); override;
|
||||
procedure OnRenderViewReady(const browser: ICefBrowser); override;
|
||||
procedure OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus); override;
|
||||
procedure OnDocumentAvailableInMainFrame(const browser: ICefBrowser); override;
|
||||
|
||||
public
|
||||
constructor Create(const events : IChromiumEvents); reintroduce; virtual;
|
||||
@ -281,6 +283,17 @@ begin
|
||||
status);
|
||||
end;
|
||||
|
||||
procedure cef_request_handler_on_document_available_in_main_frame(self : PCefRequestHandler;
|
||||
browser : PCefBrowser); stdcall;
|
||||
var
|
||||
TempObject : TObject;
|
||||
begin
|
||||
TempObject := CefGetObject(self);
|
||||
|
||||
if (TempObject <> nil) and (TempObject is TCefRequestHandlerOwn) then
|
||||
TCefRequestHandlerOwn(TempObject).OnDocumentAvailableInMainFrame(TCefBrowserRef.UnWrap(browser));
|
||||
end;
|
||||
|
||||
function cef_request_handler_on_select_client_certificate( self : PCefRequestHandler;
|
||||
browser : PCefBrowser;
|
||||
isProxy : integer;
|
||||
@ -347,16 +360,17 @@ begin
|
||||
|
||||
with PCefRequestHandler(FData)^ do
|
||||
begin
|
||||
on_before_browse := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_before_browse;
|
||||
on_open_urlfrom_tab := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_open_urlfrom_tab;
|
||||
get_resource_request_handler := {$IFDEF FPC}@{$ENDIF}cef_request_handler_get_resource_request_handler;
|
||||
get_auth_credentials := {$IFDEF FPC}@{$ENDIF}cef_request_handler_get_auth_credentials;
|
||||
on_quota_request := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_quota_request;
|
||||
on_certificate_error := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_certificate_error;
|
||||
on_select_client_certificate := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_select_client_certificate;
|
||||
on_plugin_crashed := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_plugin_crashed;
|
||||
on_render_view_ready := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_view_ready;
|
||||
on_render_process_terminated := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_process_terminated;
|
||||
on_before_browse := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_before_browse;
|
||||
on_open_urlfrom_tab := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_open_urlfrom_tab;
|
||||
get_resource_request_handler := {$IFDEF FPC}@{$ENDIF}cef_request_handler_get_resource_request_handler;
|
||||
get_auth_credentials := {$IFDEF FPC}@{$ENDIF}cef_request_handler_get_auth_credentials;
|
||||
on_quota_request := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_quota_request;
|
||||
on_certificate_error := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_certificate_error;
|
||||
on_select_client_certificate := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_select_client_certificate;
|
||||
on_plugin_crashed := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_plugin_crashed;
|
||||
on_render_view_ready := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_view_ready;
|
||||
on_render_process_terminated := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_render_process_terminated;
|
||||
on_document_available_in_main_frame := {$IFDEF FPC}@{$ENDIF}cef_request_handler_on_document_available_in_main_frame;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -442,6 +456,11 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefRequestHandlerOwn.OnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TCefRequestHandlerOwn.OnRenderViewReady(const browser: ICefBrowser);
|
||||
begin
|
||||
//
|
||||
@ -585,12 +604,20 @@ end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderProcessTerminated(const browser: ICefBrowser; status: TCefTerminationStatus);
|
||||
begin
|
||||
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRenderProcessTerminated(browser, status);
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderProcessTerminated(browser, status);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnDocumentAvailableInMainFrame(const browser: ICefBrowser);
|
||||
begin
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnDocumentAvailableInMainFrame(browser);
|
||||
end;
|
||||
|
||||
procedure TCustomRequestHandler.OnRenderViewReady(const browser: ICefBrowser);
|
||||
begin
|
||||
if (FEvents <> nil) then IChromiumEvents(FEvents).doOnRenderViewReady(browser);
|
||||
if (FEvents <> nil) then
|
||||
IChromiumEvents(FEvents).doOnRenderViewReady(browser);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -238,6 +238,7 @@ type
|
||||
PCefWindowDelegate = ^TCefWindowDelegate;
|
||||
PCefBoxLayoutSettings = ^TCefBoxLayoutSettings;
|
||||
PCefRegistration = ^TCefRegistration;
|
||||
PCefDevToolsMessageObserver = ^TCefDevToolsMessageObserver;
|
||||
PCefMediaRouter = ^TCefMediaRouter;
|
||||
PCefMediaRoute = ^TCefMediaRoute;
|
||||
PPCefMediaRoute = ^PCefMediaRoute;
|
||||
@ -1584,6 +1585,16 @@ type
|
||||
base : TCefBaseRefCounted;
|
||||
end;
|
||||
|
||||
// /include/capi/cef_devtools_message_observer_capi.h (cef_dev_tools_message_observer_t)
|
||||
TCefDevToolsMessageObserver = record
|
||||
base : TCefBaseRefCounted;
|
||||
on_dev_tools_message : function(self: PCefDevToolsMessageObserver; browser: PCefBrowser; const message_: Pointer; message_size: NativeUInt): Integer; stdcall;
|
||||
on_dev_tools_method_result : procedure(self: PCefDevToolsMessageObserver; browser: PCefBrowser; message_id, success: Integer; const result: Pointer; result_size: NativeUInt); stdcall;
|
||||
on_dev_tools_event : procedure(self: PCefDevToolsMessageObserver; const method: PCefString; const params: Pointer; params_size: NativeUInt); stdcall;
|
||||
on_dev_tools_agent_attached : procedure(self: PCefDevToolsMessageObserver; browser: PCefBrowser); stdcall;
|
||||
on_dev_tools_agent_detached : procedure(self: PCefDevToolsMessageObserver; browser: PCefBrowser); stdcall;
|
||||
end;
|
||||
|
||||
// /include/capi/cef_media_router_capi.h (cef_media_router_t)
|
||||
TCefMediaRouter = record
|
||||
base : TCefBaseRefCounted;
|
||||
@ -1939,17 +1950,18 @@ type
|
||||
|
||||
// /include/capi/cef_request_handler_capi.h (cef_request_handler_t)
|
||||
TCefRequestHandler = record
|
||||
base : TCefBaseRefCounted;
|
||||
on_before_browse : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; request: PCefRequest; user_gesture, isRedirect: Integer): Integer; stdcall;
|
||||
on_open_urlfrom_tab : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; const target_url: PCefString; target_disposition: TCefWindowOpenDisposition; user_gesture: Integer): Integer; stdcall;
|
||||
get_resource_request_handler : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; request: PCefRequest; is_navigation, is_download: Integer; const request_initiator: PCefString; disable_default_handling: PInteger): PCefResourceRequestHandler; stdcall;
|
||||
get_auth_credentials : function(self: PCefRequestHandler; browser: PCefBrowser; const origin_url: PCefString; isProxy: Integer; const host: PCefString; port: Integer; const realm, scheme: PCefString; callback: PCefAuthCallback): Integer; stdcall;
|
||||
on_quota_request : function(self: PCefRequestHandler; browser: PCefBrowser; const origin_url: PCefString; new_size: Int64; callback: PCefRequestCallback): Integer; stdcall;
|
||||
on_certificate_error : function(self: PCefRequestHandler; browser: PCefBrowser; cert_error: TCefErrorcode; const request_url: PCefString; ssl_info: PCefSslInfo; callback: PCefRequestCallback): Integer; stdcall;
|
||||
on_select_client_certificate : function(self: PCefRequestHandler; browser: PCefBrowser; isProxy: integer; const host: PCefString; port: integer; certificatesCount: NativeUInt; const certificates: PPCefX509Certificate; callback: PCefSelectClientCertificateCallback): integer; stdcall;
|
||||
on_plugin_crashed : procedure(self: PCefRequestHandler; browser: PCefBrowser; const plugin_path: PCefString); stdcall;
|
||||
on_render_view_ready : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
on_render_process_terminated : procedure(self: PCefRequestHandler; browser: PCefBrowser; status: TCefTerminationStatus); stdcall;
|
||||
base : TCefBaseRefCounted;
|
||||
on_before_browse : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; request: PCefRequest; user_gesture, isRedirect: Integer): Integer; stdcall;
|
||||
on_open_urlfrom_tab : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; const target_url: PCefString; target_disposition: TCefWindowOpenDisposition; user_gesture: Integer): Integer; stdcall;
|
||||
get_resource_request_handler : function(self: PCefRequestHandler; browser: PCefBrowser; frame: PCefFrame; request: PCefRequest; is_navigation, is_download: Integer; const request_initiator: PCefString; disable_default_handling: PInteger): PCefResourceRequestHandler; stdcall;
|
||||
get_auth_credentials : function(self: PCefRequestHandler; browser: PCefBrowser; const origin_url: PCefString; isProxy: Integer; const host: PCefString; port: Integer; const realm, scheme: PCefString; callback: PCefAuthCallback): Integer; stdcall;
|
||||
on_quota_request : function(self: PCefRequestHandler; browser: PCefBrowser; const origin_url: PCefString; new_size: Int64; callback: PCefRequestCallback): Integer; stdcall;
|
||||
on_certificate_error : function(self: PCefRequestHandler; browser: PCefBrowser; cert_error: TCefErrorcode; const request_url: PCefString; ssl_info: PCefSslInfo; callback: PCefRequestCallback): Integer; stdcall;
|
||||
on_select_client_certificate : function(self: PCefRequestHandler; browser: PCefBrowser; isProxy: integer; const host: PCefString; port: integer; certificatesCount: NativeUInt; const certificates: PPCefX509Certificate; callback: PCefSelectClientCertificateCallback): integer; stdcall;
|
||||
on_plugin_crashed : procedure(self: PCefRequestHandler; browser: PCefBrowser; const plugin_path: PCefString); stdcall;
|
||||
on_render_view_ready : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
on_render_process_terminated : procedure(self: PCefRequestHandler; browser: PCefBrowser; status: TCefTerminationStatus); stdcall;
|
||||
on_document_available_in_main_frame : procedure(self: PCefRequestHandler; browser: PCefBrowser); stdcall;
|
||||
end;
|
||||
|
||||
// /include/capi/cef_request_callback_capi.h (cef_request_callback_t)
|
||||
@ -2856,6 +2868,9 @@ type
|
||||
show_dev_tools : procedure(self: PCefBrowserHost; const windowInfo: PCefWindowInfo; client: PCefClient; const settings: PCefBrowserSettings; const inspect_element_at: PCefPoint); stdcall;
|
||||
close_dev_tools : procedure(self: PCefBrowserHost); stdcall;
|
||||
has_dev_tools : function(self: PCefBrowserHost): Integer; stdcall;
|
||||
send_dev_tools_message : function(self: PCefBrowserHost; const message_: Pointer; message_size: NativeUInt): Integer; stdcall;
|
||||
execute_dev_tools_method : function(self: PCefBrowserHost; message_id: integer; const method: PCefString; params: PCefDictionaryValue): Integer; stdcall;
|
||||
add_dev_tools_message_observer : function(self: PCefBrowserHost; observer: PCefDevToolsMessageObserver): PCefRegistration; stdcall;
|
||||
get_navigation_entries : procedure(self: PCefBrowserHost; visitor: PCefNavigationEntryVisitor; current_only: Integer); stdcall;
|
||||
set_mouse_cursor_change_disabled : procedure(self: PCefBrowserHost; disabled: Integer); stdcall;
|
||||
is_mouse_cursor_change_disabled : function(self: PCefBrowserHost): Integer; stdcall;
|
||||
|
@ -2,9 +2,9 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 146,
|
||||
"InternalVersion" : 147,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "83.3.12.0"
|
||||
"Version" : "83.4.0.0"
|
||||
}
|
||||
],
|
||||
"UpdatePackageData" : {
|
||||
|
Reference in New Issue
Block a user