DoOnLoadStart/doOnLoadEnd doesn't work.
Posted: Fri Jun 08, 2018 11:28 am
Hi, I programmatically create a browser and try to use doOnLoadStart/doOnLoadEnd procedure, but it is never called. In the same time, for example, function doOnGetResourceHandler works normally. What is the problem?
Code: Select all
unit cef4exp1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uCEFWindowParent, uCEFChromiumWindow,
uCEFChromium, uCEFInterfaces, uCEFConstants, uCEFTypes, Vcl.StdCtrls;
type
chrome = class(TChromium)
private
public
procedure doOnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType);override;
end;
type
TForm1 = class(TForm)
CEFWindowParent1: TCEFWindowParent;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
end;
var
Form1: TForm1; ch:chrome;
implementation
{$R *.dfm}
procedure chrome.doOnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: Cardinal);
begin
form1.Caption:='Procedure works';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ch:=chrome.Create(Form1);
ch.CreateBrowser(CEFWindowParent1);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if ch.Initialized then ch.LoadURL('google.com');
end;
end.