Hi there! I’m trying to use html2.WebView but things don’t work as expected:
- On a mac machine, everything works well
- On a windows 11 Pro machine, wx.html2.WebViewBackendEdge is not supported, only wx.html2.WebViewBackendIE, which is quite useless nowadays.
Technical specs:
Python 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)] on win32
wxpython 4.2.2 (installed using pip install wxpython)
I’ve been through all historic posts and web searched this issue to no avail. It seems like there is no need to install Microsoft Edge WebView2, as nowadays it comes installed out of the box (though, of course, I might be wrong). Any ideas? Thanks!
I don’t use WebView myself, but running the wxPython demo with my 4.2.2 installations results in this, which looks fine:
One of my installations uses the PIP version, the other was built by myself.
Does the demo work for you?
I would guess that the documentation is not up to date:
“This backend is not enabled by default,”
https://docs.wxpython.org/wx.html2.WebView.html#phoenix-title-webview-backend-edge-msw
P.S.: This is on Windows 10, but usually there is no difference between 10 and 11. If the demo does not work for you, I will try on 11.
1 Like
First and foremost, thanks so much for the super quick response!
For me, the demo shows:
08:18:33: Backend ‘wx.html2.WebViewBackendEdge’ availability: False
(see screenshot below)
I’ve tried activating the edge backend in various ways, to no avail.
I’ve tested this on 2 separate machines, and on both I got the same result. AFAIK, this is a standard windows 11 Pro installation. Anyway, it help to know that this can work on modern windows machines.
What version of EDGE do you have?
A long time ago, the standard version did not work, only a beta version.
Version 131.0.2903.112 (Official build) (64-bit) - just like yours…
Do you have the WebView2Loader.dll in your wx installation directory?
Yes I do. Thanks for not giving up
Yesterday I tried building wxWidgets with an Edge backend, but that does not seem so easy.
The wxPython build somehow gets the Edge backend right.
You may want to build wxPython yourself and then build it’s included wx version with Visual Studio. In wxWidgets/samples there is a webview sample. You could then step through using the Visual Studio debugger.
I started that path a few days ago, but it got messy. I’ll probably try again. Will update if there’s any good news!
In your original post you said:
It seems like there is no need to install Microsoft Edge WebView2, as nowadays it comes installed out of the box
However, I have seen comments elsewhere that it may become broken if any of its files become corrupted (for example by a failed Windows Update).
Have you tried re-installing it? - see: Microsoft Edge WebView2 | Microsoft Edge Developer