WebView for FireMonkey

WebView for FireMonkey

Delphi and C++ Builder component to host web content in your applications.
  • uses Microsoft WebView2 API
  • requires WebView2 Runtime version 105.0.1343.27 or newer
  • supports Delphi/C++ Builder XE4 - 11.2
  • source code included in registered version
  • royalty free distribution in applications

Download and order

FAQ

What version of Edge (Chromium) browser is required?
WebView2 Runtime has to be installed. WebView2 API can't use Edge browser: path containing \Edge\Application\ is explicitly tested and disallowed.
WebView2 Runtime is deployed with many applications, including Microsoft Office, and it's inbox in Windows 11 machines.

How can I allow OnWebResourceRequested events?
Set URI filter:
							FWebView.AddFilter;
							
How can I set custom response?
procedure TFormMain.FWebViewWebResourceRequested(Sender: TObject;
  const Request: TWebResourceRequest; var Response: TWebResourceResponse);
const Content = '<html><body>Hello!</body></html>';
begin
  Response := FWebView.CreateResponse;
  Response.Content.Write(Content, Length(Content));
end;
							
What format is accepted in the Language property?
The format is language[-country] where language is the 2-letter code from ISO 639 and country is the 2-letter code from ISO 3166. Examples: SK, SK-SK, EN-SK, EN-US.

Why is the Active property False after setting it to True?
Active property is updated asynchronously. Use OnActive event to detect when Active value is changed.

How can I print the web page?
FWebView.ExecuteScript('window.print()');
							
How can I convert web page to PDF format?
FWebView.PrintToPdf('C:\webpage.pdf');
							
How can I log to Google account?
Set user agent in OnActive event handler to some non-default value:
procedure TFormMain.FWebViewActive(Sender: TObject);
begin
  FWebView.UserAgent := 'Embedded browser';
end;
							
How can I navigate using a custom request?
procedure TFormMain.FWebViewActive(Sender: TObject);
var Request: TWebResourceRequest;
begin
  Request := FWebView.CreateRequest('https://www.winsoft.sk', 'GET', '');
  try
    FWebView.Navigate(Request);
  finally
    Request.Free;
  end;
end;
							

Related links