In some cases, TTMSFNCEdgeWebBrowser.GetURL does not return current values. On the https://web2te-ksef.mf.gov.pl/web/ website, clicking [Uwierzytelnij się w Krajowym Systemie] opens the https:// web2te-ksef.mf.gov.pl/web/login, the OnHistoryChanged event is triggered, but GetURL remains https://web2te-ksef.mf.gov.pl/web/ .
Please help.
Hi,
It seems the event when a navigation occurs is not getting called so basically it's not getting a redirect. This is default behavior of the webview, FURL is not getting updated. if OnHistoryChanged is getting called, you can retrieve the new URL there.
procedure TForm7.TMSFNCEdgeWebBrowser1HistoryChanged(Sender: TObject);
var
w: ICoreWebView2;
p: PWideChar;
url: string;
begin
if (TMSFNCEdgeWebBrowser1.GetWebBrowserInstance as ICoreWebView2Controller).get_CoreWebView2(w) = S_OK then
begin
w.get_Source(@p);
url := p;
end;
end;
add the FMX.TMSFNCWebBrowser.Win unit