Page 1 of 7
WebView4Delphi updates
Posted: Sat Dec 04, 2021 3:58 pm
by salvadordf
The first version of
WebView4Delphi has been released!
WebView4Delphi allows you to embed Chromium based web browsers in your Delphi or Lazarus applications using the
WebView2 runtime.
WebView4Delphi uses the
Microsoft Edge WebView2 Runtime and
Microsoft.Web.WebView2 NuGet package to embed a web browser.
Before you try WebView4Delphi you have to download the Microsoft Edge WebView2 Runtime from here :
https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section
If you install the evergreen version of the runtime it will be updated automatically with Windows Update but you can also decompress the fixed version in your computer and configure WebView4Delphi to use it.
WebView4Delphi also uses the latest stable version of the WebView2 nuget package 1.0.1054.31 found here :
https://www.nuget.org/packages/Microsoft.Web.WebView2
All the demos use the WebView2Loader.dll file included in the Microsoft.Web.WebView2 NuGet package. A copy of WebView2Loader.dll can be found in the bin32 and bin64 directories.
All the demos are configured to use the evergreen version of the runtime and the executable is created inside the bin32 and bin64 directories.
Re: WebView4Delphi updates
Posted: Sun Dec 19, 2021 11:30 am
by salvadordf
The last WebView4Delphi update included these changes :
- Added the KioskBrowser demo.
- Added TWVBrowserBase.OnWidget0CompMsg, TWVBrowserBase.OnWidget1CompMsg, TWVBrowserBase.OnRenderCompMsg and TWVBrowserBase.OnD3DWindowCompMsg to intercept Windows messages.
- Added an additional registry check in TWVLoader to detect if the WebView2 runtime is installed.
- Added a custom TPopupMenu thanks to Alessandro Mancini.

- Navigate to "about:blank" in TWVBrowser if the user doesn't specify a default URL.
Re: WebView4Delphi updates
Posted: Wed Dec 22, 2021 7:38 pm
by salvadordf
Due to initialization problems in some applications I've reverted the default TWVBrowser.DefaultURL value to an empty string.
Please, download WebView4Delphi again from GitHub.
I'm sorry for the problems caused.
Re: WebView4Delphi updates
Posted: Thu Dec 23, 2021 4:45 pm
by salvadordf
This is what's new in the last WebView4Delphi update :
- Added the EditorBrowser demo.
- Fixed build issue in Lazarus.
- Lazarus demos : Fixed string conversion in showmessage calls
- Added TWVBrowser.RetrieveHTML
- Added TWVBrowser.RetrieveText
- Added TWVBrowser.OnPrintCompleted
- Added TWVBrowser.OnRetrieveHTMLCompleted
- Added TWVBrowser.OnRetrieveTextCompleted
The TWVBrowser.RetrieveHTML call will trigger the TWVBrowser.OnRetrieveHTMLCompleted event with the HTML.
The TWVBrowser.RetrieveText call will trigger the TWVBrowser.OnRetrieveTextCompleted event with the document's text.
The TWVBrowser.Print call will trigger the TWVBrowser.OnPrintCompleted event when it finishes printing.
All those functions use JavaScript code due to the WebView2 limitations and I had to add some constants to identify the JavaScript results in TWVBrowser.OnExecuteScriptCompleted
RetrieveHTML, RetrieveText and Print call TWVBrowser.ExecuteScript with these reserved "aExecutionID" values that I added to uWVConstants :
- WEBVIEW4DELPHI_JS_PRINTJOB_ID
- WEBVIEW4DELPHI_JS_RETRIEVEHTMLJOB_ID
- WEBVIEW4DELPHI_JS_RETRIEVETEXTJOB_ID
TWVBrowser.RetrieveHTML is based in the code created by
Alessandro Mancini. Thank you!

Re: WebView4Delphi updates
Posted: Wed Dec 29, 2021 5:11 pm
by salvadordf
This is what's new in WebView4Delphi since the last announcement :
- KioskBrowser demo: Replaced JS code with a simple property to disable the context menu.
- MiniBrowser demo : Added a menu option to change the User Agent string.
- Added missing dependency used by older Delphi versions.
- Added TWVBrowser.IsNavigating
- Added TWVBrowser.RetrieveMHTML
- Added TWVBrowser.OnRetrieveMHTMLCompleted
- Reserved an execution id value range for internal use by some DevTools method calls.
- MiniBrowser demo : Condensed all load and save functions in 2 menu items with several dialog filters.
- MiniBrowser demo : Added MHTML support in the new open and save dialog filter options.
- Added TWVBrowserBase.OnClearCacheCompleted
- Added TWVBrowserBase.OnClearDataForOriginCompleted
- Added TWVBrowserBase.OnOfflineCompleted
- Added TWVBrowserBase.OnIgnoreCertificateErrorsCompleted
- Expose ICoreWebView2CompositionController methods and properties in TWVBrowserBase too
- Added TWVBrowser.RefreshIgnoreCache
- Added TWVBrowser.OnRefreshIgnoreCacheCompleted
- Added new popup windows and new tab support to the TabbedBrowser demos.
Re: WebView4Delphi updates
Posted: Fri Dec 31, 2021 11:50 am
by salvadordf
The latest WebView4Delphi update included these changes :
- Added a aResourceID parameter to the TWVBrowserBase.OnWebResourceResponseViewGetContentCompleted event.
- Renamed TWVBrowserBase.doIgnoreCertificateErrorsCompleted to TWVBrowserBase.doOnIgnoreCertificateErrorsCompleted.
The new aResourceID parameter allows you to keep track of which content request made with a TCoreWebView2WebResourceResponseView.GetContent call triggered the TWVBrowserBase.OnWebResourceResponseViewGetContentCompleted event.
If you try to get the response content of a request then you can use the TWVBrowserBase.OnWebResourceResponseReceived event to get the ICoreWebView2WebResourceResponseReceivedEventArgs instance which allows you to create a TCoreWebView2WebResourceResponseView instance.
Then you can create a TCoreWebView2WebResourceResponseViewGetContentCompletedHandler instance and call TCoreWebView2WebResourceResponseView.GetContent.
The TWVBrowserBase.OnWebResourceResponseViewGetContentCompleted will be triggered with the contents and the same "
aResourceID" given when you created the TCoreWebView2WebResourceResponseViewGetContentCompletedHandler instance. This allows you to identify the resource and to free all the classes related to this request.
Re: WebView4Delphi updates
Posted: Fri Jan 07, 2022 7:04 pm
by salvadordf
These are the changes since the last announcement :
- Added GlobalWebView2Loader.RemoteDebuggingPort
- Added TWVBRowserBase.SimulateKeyEvent
- Added TWVBRowserBase.KeyboardShortcutSearch
- Added TWVBRowserBase.KeyboardShortcutRefreshIgnoreCache
- Added TWVBRowserBase.OnSimulateKeyEventCompleted
- Added JSONEscape in uWVMiscFunctions
- Fixed JSONUnescape declaration
- Added TWVBrowserBase.RenderCompHWND
- Added TWVBrowserBase.Widget0CompHWND
- Added TWVBrowserBase.Widget1CompHWND
- Added TWVBrowserBase.D3DWindowCompHWND
Update to WebView2 NuGet 1.0.1072.54
Posted: Tue Jan 11, 2022 2:45 pm
by salvadordf
Hi,
WebView4Delphi has been updated to WebView2 NuGet 1.0.1072.54
This is what's new :
- Added the TWVBrowserBase.OnIsMutedChanged event.
- Added the TWVBrowserBase.OnIsDocumentPlayingAudioChanged event.
- Added the TWVBrowserBase.OnIsDefaultDownloadDialogOpenChanged event.
- Added the TWVBrowserBase.ToggleMuteState procedure.
- Added the TWVBrowserBase.IsMuted property.
- Added the TWVBrowserBase.IsDocumentPlayingAudio property.
- Added the TWVBrowserBase.IsDefaultDownloadDialogOpen property.
- Added the TWVBrowserBase.DefaultDownloadDialogCornerAlignment property.
- Added the TWVBrowserBase.DefaultDownloadDialogMargin property.
- Added the TWVBrowserBase.OpenDefaultDownloadDialog function.
- Added the TWVBrowserBase.CloseDefaultDownloadDialog function.
- Updated the WebView2Loader.dll libraries.
Re: WebView4Delphi updates
Posted: Sun Jan 16, 2022 12:01 pm
by salvadordf
These are the changes since the last announcement :
- Fixed an issue assigning values to the proxy settings.
- Added more code comments with WebView2 API references for many properties and events.
Re: WebView4Delphi updates
Posted: Sat Jan 29, 2022 2:38 pm
by salvadordf
Hi,
The latest update separated the VCL and FMX packages thanks to Larry Hengen (lhengen)
This change will reduce the size of the final EXE if you use VCL.