Hi Salvador,
could you please check this?
Here is the code behind "LoadingStateChange" on MiniBrowser demo
Code: Select all
procedure TMiniBrowserFrm.Chromium1LoadingStateChange(Sender: TObject;
const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
begin
if not(Chromium1.IsSameBrowser(browser)) or FClosing then exit;
// This event is executed in a CEF thread and this can cause problems when
// you change the 'Enabled' and 'Visible' properties from VCL components.
// It's recommended to change the 'Enabled' and 'Visible' properties
// in the main application thread and not in a CEF thread.
// It's much safer to use PostMessage to send a message to the main form with
// all this information and update those properties in the procedure handling
// that message.
BackBtn.Enabled := canGoBack;
ForwardBtn.Enabled := canGoForward;
if isLoading then
begin
StatusBar1.Panels[0].Text := 'Loading...';
ReloadBtn.Enabled := False;
StopBtn.Enabled := True;
end
else
begin
StatusBar1.Panels[0].Text := 'Finished';
ReloadBtn.Enabled := True;
StopBtn.Enabled := False;
end;
end;
And here is code behind "LoadingStateChange" on my browser
Code: Select all
{ - <<< - [ handling navigation events... ] - >>> - }
procedure TfrmMain.chromiumMainLoadingStateChange(Sender: TObject;
const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
begin
if not(chromiumMain.IsSameBrowser(browser)) then
Exit;
btnBack.Enabled := canGoBack; { enable this to activate the button }
btnForward.Enabled := canGoForward; { enable this to activate the button }
if isLoading then
begin
statusbarMain.Panels[0].text := 'Loading...';
btnRefresh.Enabled := False; { enable this to activate the button }
end
else
begin
statusbarMain.Panels[0].text := 'Finished';
btnRefresh.Enabled := True; { enable this to activate the button }
end;
end;
I see no difference but still,
when the browser is executed, the "Previous/Back" button is usable and it takes me to a blank white page with no content in it (named as "about:blank") in both my browser and also MiniBrowser.
Any ideas?
What i need to do is to prevent going back if nothing has been navigated.
Thanks!