Skip to content

[Edge] Add fallback when WebView2 runtime is not present #2000 #2065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HeikoKlare
Copy link
Contributor

When using WebView2 as browser engine in SWT without a WebView2 runtime being available on the system, browser initialization fails. In order to more gracefully handle the case that a system has no such runtime installed (like on some Windows 10 systems), this change introduces an automatic fallback to Internet Explorer in case no WebView2 runtime is found. In addition, it shows an error dialog informing about the missing runtime and showing a link to FAQ about it.

Fixes #2000

This is supposed to raise an alternative for how to handle the situation that a WebView2 runtime is not present on the current system in addition to:

I do not want to argue for doing it like this, but I would like to give this option to general discussion.
cc @sratz

Copy link
Contributor

github-actions bot commented Apr 25, 2025

Test Results

   545 files  + 6     545 suites  +6   29m 21s ⏱️ +56s
 4 374 tests +37   4 356 ✅ +35   18 💤 +3  0 ❌  - 1 
16 638 runs  +37  16 498 ✅ +35  140 💤 +3  0 ❌  - 1 

Results for commit c4902b0. ± Comparison against base commit 788ba23.

♻️ This comment has been updated with latest results.

@GooogLeMorons
Copy link

i've picked a little this micro$oft stuff pile...

in win11 there is Edge and so called 'OnDemand' pre-installed 'Microsoft-Windows-InternetExplorer-Optional-Package' IE-Edge adapter('dism /online /get-packages /format:table').

looks like the '-Dorg.eclipse.swt.browser.DefaultType=ie' eclipse.ini hat trick (#1912) utilizes 'SWT -> IE-Edge adapter -> m$ Edge' chain. in my case e.g. context help tooltips lose warning 'NOTE: The SWT Browser widget could not be created...' and become richer, Welcome screen at least shows built-in '404' html and 'Tip of the day' (in build I20250423-0800) become fully-functional.

without this magic eclipse.ini option - even if 'General / Web browser / Use external ... / Internet explorer' option is selected - seems Eclipse fully relies on 'SWT -> WebView2 -> m$ Edge' chain. for me (v. 4.35.0 on Win11) even if the chain is fully-functional and WebView2 is already provided by Edge, there is a need to overbloat os with m$ Evergreed WebView2 runtime and extremely annoying blocker forcing to get rid of WebView2 totally(#2061)

so, '-Dorg.eclipse.swt.browser.DefaultType=ie' + Microsoft-Windows-InternetExplorer-Optional-Package (probably available on Win11, or 'dism /add-package ...') + m$ Edge (seems available on most of Win11) could be a workaround.

The thing is there can be nether WebView2/Microsoft-Windows-InternetExplorer-Optional-Package, nor m$ Edge - at least on Win11 in EU, where m$ 'kindly allows' users to remove Edge(e.g. i got my config by uninstalling it and setting up Firefox instead).
i think the situation worths attention - what should Eclipse do in this case? at least it shouldn't crash and spawn 'unhandled exception' popups.

@HeikoKlare
Copy link
Contributor Author

I have to admit that I am not sure what concrete issue you are actually referring to. I have the impression that nothing stated really relates to Edge/WebView2 and making it default in Eclipse but relates to the overall concept of browser integration in Eclipse (see also my comment #2000 (comment)). With VM argument '-Dorg.eclipse.swt.browser.DefaultType=ie you switch back to the exact behavior you have for years in Eclipse on Windows. Nothing has changed with respect to that recently. If you don't want to have WebView2 installed in your system, you are free to use that option as long as it keeps working. If it's about changed behavior between WebView2 not being installed compared to IE not being available, please precisely point that out (as I asked for in #2000 (comment)). If you have concerns about how Eclipse integrates browsers in general, I propose to open a separate issue about that and discuss the requirements for a chance and the actual options there.

Regarding the handling of WebView2 runtime not being present, we have started to make concrete proposal (like this one) to discuss about. But currently I only see complains rather than (feedback on) actual proposals.

…form#2000

When using WebView2 as browser engine in SWT without a WebView2 runtime
being available on the system, browser initialization fails. In order to
more gracefully handle the case that a system has no such runtime
installed (like on some Windows 10 systems), this change introduces an
automatic fallback to Internet Explorer in case no WebView2 runtime is
found. In addition, it shows an error dialog informing about the missing
runtime and showing a link to FAQ about it.

Fixes eclipse-platform#2000
@akurtakov akurtakov force-pushed the issue-2000-alternative branch from 542d408 to c4902b0 Compare May 2, 2025 05:21
@GooogLeMorons
Copy link

I have to admit that I am not sure what concrete issue you are actually referring to. I have the impression that nothing stated really relates to Edge/WebView2 and making it default in Eclipse but relates to the overall concept of browser integration in Eclipse...

well, let's figure it out: SWT samples, Windows, no WebView2 runtime.

SWT Browser sample failure
(and even if SWT Browser sample expects WebView2 by default, SWT FAQ still refers to IE11 and states Edge support is limited)

there is SWT Browser widget which, sure, Eclipse relies and uses. looks like it is the root cause of these "missing Edge" failures.
in the general discussion was proposed, what exactly need to be discussed: an alternative to the SWT Browser widget, its default mode (ie|edge) in Eclipse on Windows, or something else wasn't explicitly specified?

flaws of WebView2 implementation, problems they cause and obvious way of avoiding them by avoiding WebView2 itself do not apply here - ok.

there is no room to discuss general Eclipse browser integration here - fine.

SWT Browser widget issues related to Edge/WebView2 integration have to be addressed in SWT repository - sure.

so what is all this talk about? - the problem exists, there is some patch on it and let it stay that way?

is it possible to propose something here without taking into account what exact features of WebView2 are used for which purposes and do we need all this to continue programming just as effectively and comfortably in Eclipse?
there is JEditorPane available in JDK, but it isn't clear if it's outdated HTML 3.2 fits the needs. there is JavaFX WebView, but it requires additional download. looks like it is impossible to resolve the issue without breaking the discussion frame was set.

Regarding the handling of WebView2 runtime not being present, we have started to make concrete proposal (like this one) to discuss about. But currently I only see complains rather than (feedback on) actual proposals.

yes, you may not like my tonality. so, firstly - in the vein of the announced general discussion - haven't you been kindly told before about observed degradation in the polite, friendly manner? and what is the result of that messages - the degradation isn't as rapid and comprehensive as it could be?
you can object "everything is done here on enthusiasm without any guarantees and obligations, so be grateful for what you have" - ​​in general you will be right saying this. and we will be grateful - be sure - from the bottom of our hearts and souls. just don't break what already works and don't impose features that create more headaches than benefits, please. well, really, who welcomes after update new series of nearly finger-sucked error popups and crumbles of functionality that worked fine before

and secondly. it seems no other input on the declared subject has been brought here yet. at all.)))
so, maybe, someone finally suggest something more interesting and in a more constructive way, seeing all this?

@merks
Copy link
Contributor

merks commented May 2, 2025

It would seem more productive to get edge/webview working. That is the way forward while ie is behind us. It an unfortunate thing that ie has been a horrible abomination for a very long time. No one wants to author html that renders correctly on ie and in a real browser. It really does seem best to move on from this. Sorry if that sounds harsh. There is just way too much to do and way too few people to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[windows] WebView2 runtime not found
3 participants