pyscripter 689 Posted September 28, 2020 One of the new features of Delphi 10.4 was the new TEdgeBrowser component. It is nice. However the downside is that certain steps are needed for the use and delployment of this component: Install Edge WebView2 package via GetIt. This places a Dll called WebView2Loader.dll in the redist directory of Embarcadero studio (one for win32, one for win64). The appropriate WebView2Loader.dll needs to be deployed alongside your executable. (about 300Kb). While developing you can add a post-build event to do that. Now the difficult one was that you had to replace the stable version of Edge, installed and managed by Windows, with the unstable one from the Canary Edge update channel (daily updates). Event if you did that in your own machine, few users would accept it. The new thing, that is not mentioned in the documentation, is that there is a better alternative to the third requirement. You can use the WebView2 Runtime installer which works independently from and does not interfere with your browser, and can be safely deployed in customer sites. Give it a try. 2 Share this post Link to post
Vincent Parrett 750 Posted September 29, 2020 Where does it put the dll? I installed it but have no idea where the dll lives. Only asking as I wanted to see if both 32 and 64bit were installed, as only a 64bit installer was offered. Share this post Link to post
Der schöne Günther 316 Posted September 29, 2020 There are several ways to ship the edge runtime: Check if the runtime is installed - If not, install it Install Edge Dev or Canary Ship your own edge dlls Option 3 is called "fixed version distribution" and not yet available. There will be no auto-update or anything. You can read more about the different options here: Distribution of Microsoft Edge WebView2 Applications - Microsoft Edge Development | Microsoft Docs PS: 9 hours ago, pyscripter said: you had to replace the stable version of Edge, installed and managed by Windows, with the unstable one from the Canary Edge That is not true. Nothing gets replaced, they run side by side. Share this post Link to post
pyscripter 689 Posted September 30, 2020 Just reported two QA issues relevant if you are planning to use/deploy TEdgeBrowser: https://quality.embarcadero.com/browse/RSP-31163 https://quality.embarcadero.com/browse/RSP-31170 Share this post Link to post
Vincent Parrett 750 Posted September 30, 2020 Hmmm... another new feature in delphi that doesn't actually work properly.. I think I'll give it a miss for now. 2 Share this post Link to post
pyscripter 689 Posted September 30, 2020 I have added a workaround for https://quality.embarcadero.com/browse/RSP-31170 1 Share this post Link to post
Der schöne Günther 316 Posted September 30, 2020 I have always put the Edge user-data folder in the %TEMP% folder. Share this post Link to post
Mark- 29 Posted September 30, 2020 I added this comment. I added a default folder property to the class. Removed: var hr := CreateCoreWebView2Environment( Callback<HResult, ICoreWebView2Environment>.CreateAs<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( CreateEnvironmentCompleted)); Added: hr:=CreateCoreWebView2EnvironmentWithOptions('',PWideChar(FDefaultFolder),nil, Callback<HResult,ICoreWebView2Environment>. CreateAs<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>(CreateEnvironmentCompleted)); Share this post Link to post
Der schöne Günther 316 Posted October 20, 2020 For your information: WebView2 is now out of preview: Announcing Microsoft Edge WebView2 General Availability - Microsoft Edge Blog (windows.com) Instead of using the runtime (or an installed beta version), it can now also leverage a new "fixed version" (previously called "bring-your-own") which is new and in preview. 3 Share this post Link to post
vhanla 2 Posted October 24, 2020 None of them worked, I also tried recommended version from http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TEdgeBrowser_Component_and_Changes_to_the_TWebBrowser_Component 0.9.430 which fails with access error, newer versions don't show any error messages, just creates a directory called appname.exe.WebView2 which is empty unlike previous one, which fills with a bunch of files and directories but fails. I installed and copied files from fixed cab too (from https://developer.microsoft.com/en-us/microsoft-edge/webview2/ to include EmbeddedBrowserWebView.dll I have Edge canary and stable installed, both 64 bits. MyApps compiled and tried x86 and x64. dlls respectively, none of them works. --- IMHO, new fixed approach (from that installer page) seems just like CEF embedded, almost like shipping your own web browser, wasting more RAM unless you take full advantage of web technologies, I'd prefer old EdgeHTML approach (aka. WebView1.0 for Win32) it works nicely for simple tasks. https://stackoverflow.com/a/52788855/537347 I wish they'd give more freedom like CEF4Delphi, specially when using system notifications (from webpage), which is still attached to its runtime executables, also audio sessions. Both versions are like that, WebView for Win32 v1.0 and newer v2. https://github.com/MicrosoftEdge/WebView2Feedback/issues/4 CEF4Delphi as far as I remember allows to identify web notifications from your application. While Edge's embedded gives Win32WebViewHost (for previous version), and for this new one, it shows a description for desktop notification from web viewer (in your locale) which doesn't give any way to notify users which application's the notification came from, i.e. all programs using WebView2 will notifiy (web notifications) with the same application identifier (hardcoded by Microsoft). 1 Share this post Link to post
David Heffernan 2345 Posted October 25, 2020 8 hours ago, vhanla said: wasting more RAM How would RAM be wasted? Share this post Link to post
Mauro Botta 1 Posted December 10, 2021 Hi, I have tried https://stackoverflow.com/a/52788855/537347 exampe, const SWebViewControlProcess = 'Windows.Web.UI.Interop.WebViewControlProcess'; type // Interface with functionality to interact with WebBrowser Control // https://docs.microsoft.com/en-us/uwp/api/windows.web.ui.iwebviewcontrol IWebViewControl = interface(IInspectable) ['{3F921316-BC70-4BDA-9136-C94370899FAB}'] procedure Placeholder_SourceGet; safecall; procedure Placeholder_SourcePut; safecall; .. and work fine. i can open any web sites. But i can't open any local files ( and show ) , i need show a .P7M files. WinS:= TWindowsString.Create('file:\\V:\DelphiXE104_PROJECT\Test\test.xml.p7m'); don't work WinS:= TWindowsString.Create('V:\DelphiXE104_PROJECT\Test\test.xml.p7m'); don't work WinS:= TWindowsString.Create('V:\DelphiXE104_PROJECT\Test\BASE_HTML_TEMPLATE.html'); don't work Hint ? Share this post Link to post
FPiette 383 Posted December 10, 2021 2 hours ago, Mauro Botta said: Hint ? Maybe create a new message thread with a clear question? 2 Share this post Link to post
gorepj 3 Posted January 21, 2022 Hi, Has anyone got the Delphi TEdgeBrowser ZoomFactor to work? Setting Zoomfactor to 1.5 for instance has no effect. Regards Peter Share this post Link to post