Failed to initialise Edge browser control

5.3k views Asked by At

Having a hard time attempting to run an example how to use TEdgeBrowser component on Windows 10.

Using the latest RAD Studio 10.4.1 (27.0.38860.1461)

The example is located under this path:

c:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\VCL\WebBrowser\Edge\

Attempting to start results in "Failed to initialise Edge browser control".

What I tried:

  • Installed the latest stable Edge version (88.0.705.68 (Official build) (64-bit))

  • Downloaded and installed the runtime from https://developer.microsoft.com/en-us/microsoft-edge/webview2/

  • Downloaded this: https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.705.50

  • Extracted WebView2Loader.dll and placed into the same folder where the compiled executable of the above demo resides

The documentation on: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TEdgeBrowser_Component_and_Changes_to_the_TWebBrowser_Component

Seems to be out of date and refers to old 0.9.430 version. I have actually previously used Edge Canary release with that version of WebView2Loader.dll before and that has worked, but the stable version of Edge Chromium was released in the meanwhile, assuming there were breaking API changes.

So, is it even possible to use TEdgeBrowser with Edge Chromium at this point because from all that I've tried it seems pretty hopeless? To me it looks like it is hard-coded against 0.9.430 and RAD Studio 10.4.1 wasn't updated. Is there a workaround of any sort?

2

There are 2 answers

0
Marcodor On

TEdgeBrowser requires WebView2 Runtime in order to operate. More details on MS Edge Documentation website.

WebView2Loader.dll should be loadable by your application, in the same folder, known path or registered in path environement variable. Latest version is available on NuGet. Nupkg is a zip archive. Look in build\native\ folder.

TEdgeBrowser.BrowserExecutableFolder should point to WebView2 runtime folder in case of fixed version.

MS claims that evergreen version will be distributed by default in next Windows versions.

0
Vijesh V.Nair On

enter image description herefor solving this copy "WebView2Loader.dll" to your output path