wxWebViewBackendDefault under Windows

47 views
Skip to first unread message

Eric Jensen

unread,
Feb 20, 2021, 11:36:49 AMFeb 20
to wx-u...@googlegroups.com
Hi,

today i updated the wxWidgets version in one of my projects to the
latest trunk and it silently broke, because the default
wxWebViewBackend under Windows was switched from IE to Edge.

The problem was related to registering a custom scheme handler which
is currently not supported by the Edge backend.

So i'm questioning whether changing the default backend is a good
idea as long as the Edge backend doesn't support the same features?

BTW: I actively do use the Edge backend in another part of the same
application.

Regards,
Eric

Vadim Zeitlin

unread,
Feb 20, 2021, 3:43:00 PMFeb 20
to wx-u...@googlegroups.com
On Sat, 20 Feb 2021 17:36:52 +0100 Eric Jensen wrote:

EJ> today i updated the wxWidgets version in one of my projects to the
EJ> latest trunk and it silently broke, because the default
EJ> wxWebViewBackend under Windows was switched from IE to Edge.

Hi Edge and sorry to hear about this!

I was unsure about this change but I've finally decided that this should
be fine because most users wouldn't build with Edge support anyhow, as it
requires doing something special, and if they did go to the trouble of
setting up the build to use Edge, then they probably want to use it.

EJ> BTW: I actively do use the Edge backend in another part of the same
EJ> application.

But I clearly failed to take this case into account...

EJ> The problem was related to registering a custom scheme handler which
EJ> is currently not supported by the Edge backend.
EJ>
EJ> So i'm questioning whether changing the default backend is a good
EJ> idea as long as the Edge backend doesn't support the same features?

I still think that this shouldn't affect most people, for the reasons
explained above, but clearly the changes of 788bef2cf2 (Select Edge as the
default backend on MSW, 2021-02-04) were not as safe as I thought. Not sure
what to do here, to be honest.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Eric Jensen

unread,
Feb 20, 2021, 7:01:54 PMFeb 20
to Vadim Zeitlin
Hello Vadim,

Saturday, February 20, 2021, 9:42:56 PM, you wrote:

VZ> I still think that this shouldn't affect most people, for the reasons
VZ> explained above, but clearly the changes of 788bef2cf2 (Select Edge as the
VZ> default backend on MSW, 2021-02-04) were not as safe as I thought. Not sure
VZ> what to do here, to be honest.

You're probably right, that's a rare case, especially in combination
with the use of RegisterHandler.

If it was a conscious decision, let's leave it as it is. I just wanted
to bring it up in case the issue regarding non-implemented features
had been overlooked.

And maybe Edge gets support for custom scheme handlers in the not so
far future, a comment in the source hints at a possible way to
implement it.

Thanks.
Eric





--

QuentinC

unread,
Feb 21, 2021, 9:33:06 AMFeb 21
to wx-u...@googlegroups.com
Hello,

What do I need to do to revert to IE as wxWebView back-end ?

I should admit that, I'm also going to have problems if edge become the
default browser back-end in WX 3.1.5.

1 - I'm using MinGW-W64 as a compiler, and as far as I have understood,
I can only use edge back-end with MSVC. I don't want to switch compiler.
2 - I'm also using a custom handler in one of my apps, and again as far
as I have understood, custom handlers aren't supported by Edge
3 - What happens if a user hasn't yet installed edge chromium ? For
example someone under windows 7. I know that there are quite a lot of
windows 7 users, and they probably won't upgrade until their computer
completely breaks.

Thank you for your answers.

Vadim Zeitlin

unread,
Feb 21, 2021, 10:38:57 AMFeb 21
to wx-u...@googlegroups.com
On Sun, 21 Feb 2021 15:32:56 +0100 QuentinC wrote:

Q> What do I need to do to revert to IE as wxWebView back-end ?

Right now nothing because Edge is used only when it's enabled and it isn't
enabled for you.

Q> I should admit that, I'm also going to have problems if edge become the
Q> default browser back-end in WX 3.1.5.
Q>
Q> 1 - I'm using MinGW-W64 as a compiler, and as far as I have understood,
Q> I can only use edge back-end with MSVC. I don't want to switch compiler.

So you can't use Edge right now. And while I hope this will change before
3.2.0 and you will be able to use it with MinGW too, you will still have to
explicitly enable it. As long as you don't do it, it won't be used.

TcT

unread,
Feb 22, 2021, 8:35:29 AMFeb 22
to wx-users
I think as long as Edge is not enabled by default during compile time (which it isn't) it's fine to use it as default during runtime as the library user enabled it explicitly (probably because they want to use it).
By the way it doesn't matter if the user has it installed or not as it's only selected per default if it's available during runtime.

Anyway it should probably be documented in incompatible changes section of changes.txt.

Regarding the missing RegisterHandler(), I've looked into it and currently the Edge API only allows to register callbacks for http(s) URLs. It would be possible to register handlers for something like http://invalid.url/myhandler/* but it would obviously be totally different than the other backends.
Might be something to be brought up at the feedback repo for edge here:

New Pagodi

unread,
Feb 22, 2021, 11:35:10 PMFeb 22
to wx-users
There's been a ticket open for about a year on the webview2 issue tracker requesting the ability to register arbitrary protocol handlers, but it looks like little has been done in that time. As they mention in that ticket, you can partially work around it by handling NavigationStarting and FrameNavigationStarting but that will only work for the main page.  If the main page has any relative links for images, scripts, or other content, that would be resolved and served over the same protocol, those extra resources will still fail.

I was if loading those extra resources could be made to work by calling AddWebResourceRequestedFilter and using add_WebResourceRequested to handle that event.  I haven't had time to look into this further though.

Eric Jensen

unread,
Feb 23, 2021, 1:42:01 AMFeb 23
to TcT
Hello TcT,

Monday, February 22, 2021, 2:35:29 PM, you wrote:

T> Regarding the missing RegisterHandler(), I've looked into it and
T> currently the Edge API only allows to register callbacks for
T> http(s) URLs. It would be possible to register handlers for
T> something like http://invalid.url/myhandler/* but it would
T> obviously be totally different than the other backends.Might be
T> something to be brought up at the feedback repo for edge
T> here:https://github.com/MicrosoftEdge/WebView2Feedback/issues

Apparently it is planned to get implemented:
https://github.com/MicrosoftEdge/WebView2Feedback/issues/173#issuecomment-725084393


Eric




--

QuentinC

unread,
Feb 23, 2021, 10:35:59 AMFeb 23
to wx-u...@googlegroups.com
Hello,

VZ> Right now nothing because Edge is used only when it's enabled and
it isn't enabled for you.
VZ> So you can't use Edge right now. And while I hope this will change
before 3.2.0 and you will be able to use it with MinGW too, you will
still have to explicitly enable it. As long as you don't do it, it won't
be used.

Thank you for reassuring me.

Best regards
Reply all
Reply to author
Forward
0 new messages