-
Notifications
You must be signed in to change notification settings - Fork 166
[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
[Edge] Add fallback when WebView2 runtime is not present #2000 #2065
Conversation
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 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 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. |
542d408
to
c4902b0
Compare
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. |
Here you can find the rather up-to-date FAQ to Edge/IE: https://github.com/eclipse-platform/eclipse.platform/blob/master/docs/FAQ/FAQ_How_do_I_use_Edge-IE_as_the_Browser's_underlying_renderer.md
Well, the tonality has been quite harsh from the beginning. Still, I tried to help by first understanding the actual problem (I have still not properly understood it as, like Ed said, there is no good reason for adopting anything related to IE anymore) and then by investing time to make proposals. And I have also explained multiple times that no one broke anything. You can simply restore the existing behavior via a system property which has also been explained in the news entry for the Eclipse release for the case that someone experiences issues with using WebView2 (https://eclipse.dev/eclipse/news/news.html?file=4.35/platform.html).
I really hope that someone shows up who really understands the issue, sees the necessary relevance in working on it, and comes with a good proposal to help you. But maybe it would help people if you first explained what you consider interesting and constructive, given that what was proposed so far does obviously not fall into that category for you. But given the amount of feedback received so far, it might be that the relevance of the reported issue is simply not high enough for anyone to take care at all. In any case, it seems like I am the wrong person to help here. |
I would still really like to make some improvements for those people who would be fine with just being informed about the neccessity to install WebView2 (and how to do it) in case it's missing in their system (which is part of the goal of this PR). So if someone wants give to give feedback on that, it would be highly appreciated. |
Please, please do what you believe is best. You are empowered to make these decisions and there has been more than enough time for comments. |
c4902b0
to
99774ba
Compare
Alright, I turned this into an actual proposal. I adapted the initial message according to the latest changes and added screenshots to show how it would look like in case WebView2 is not available and fallback to IE is used. We could think about making this popup configurable, but in my opinion someone who does not want to use and install WebView2 at all should use the system property to switch back to IE anyway. @sratz what do you think about this proposal? I am completely open for any suggestions to better deal with the situation of WebView2 not being present. |
Hmm, I am not sure about this implicit fallback. User's will click it away and then it feels like things are running fine, but with IE not being the default anymore I suppose things will then break later somewhere. I'd prefer if this fallback was more of a deliberate choice. I am wondering whether we could
|
99774ba
to
9d7ef18
Compare
I like the idea of changing the dialog. I now did it like this: Clicking on "information" opens the FAQ in an (external) browser. Clicking on "Use IE" makes IE the used default browser (existing browsers have to be reopened). @sratz wdyt?
I am not in favor of providing a preference for this, as it quite some additional effort for a use case that we do not want to support in the long run. If need be, you can just add an according property to the INI. But if we think such a preference is useful, we may also address that in a separate change. |
Looks good! I have asked our UX experts to take a look and here are some suggestions:
Agreed. |
Thank you for all the proposals! Sounds great and I will gladly adapt it.
I fully agree. The problem is that I have currently no idea how to integrate a hyperlink into the message of a message box. That's why I used a button for it. Probably it's easier than I expect. Do you know how to do it? |
I don't think you can. A sub-class of |
Thank you! That was also my understanding. Unfortunatly, |
Damn, so it is! Sorry about that. Perhaps, then, it gets too complicated and a button would suffice as in the original proposal? |
Or maybe even the other way around: "Microsoft Edge (WebView2) is not available." Does the user need to know the technical name "WebView2"? |
I agree. I think everyone on Windows will recognize the term Edge yet be completely clueless about the term WebView2. |
9d7ef18
to
57f4170
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, bummer! Haven't thought about MessagDialog with Hyperlink support being a JFace API.
Yeah, then let's go with the button. The completed = false;
thing is a neat trick to keep it open when pressing the 'Information' button!
Just a minor spelling mistake remains, otherwise LGTM.
private static final DialogOption CANCEL_OPTION = new DialogOption(SWT.CANCEL, "Cancel"); | ||
|
||
private static final String DIALOG_TITLE = "Default browser engine not available"; | ||
private static final String DIALOG_MESSAGE = "The Microsoft Edge (WebView2) runtime not available. Do you want to use the legacy Internet Explorer engine (requires reopening browsers)?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final String DIALOG_MESSAGE = "The Microsoft Edge (WebView2) runtime not available. Do you want to use the legacy Internet Explorer engine (requires reopening browsers)?"; | |
private static final String DIALOG_MESSAGE = "The Microsoft Edge (WebView2) runtime is not available. Do you want to use the legacy Internet Explorer engine (requires reopening browsers)?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the one hand we say "runtime" and later we say "engine". Should we use the same term here? Or should we simply get rid of the terms and say:
Microsoft Edge (WebView2) is not available. Do you want to use the legacy Internet Explorer (requires reopening browsers)?
And what about getting rid of the "( )" stuff by saying:
Microsoft Edge (WebView2) is not available. Do you want to use the legacy Internet Explorer?
Note: It is necessary to reopen browsers for the change to take effect.
Or is this too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making an explicit note out of the "()" part is definitely better.
I have no strong opinion regarding usage of engine/runtime. I think it's more "precise" to refer to it as a runtime, but I think the "precision" is not relevant here and it's either to understand without. So now I adapted as follows:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how it looks now.
6e11dd5
to
0b1cb59
Compare
…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 option to Internet Explorer in case no WebView2 runtime is found. It shows a dialog informing about the missing runtime, the option to fallback to IE and also allows to open further information provided via the FAQ. Fixes eclipse-platform#2000
0b1cb59
to
f633d04
Compare
The latest responses sound as if everyone basically agrees with the proposed change. If there are no further objections, I would like to merge tomorrow for M3. |
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, once the first browser is instiantiated (either during application startup or when a view containing a browser is opened), it shows an error dialog informing about the missing runtime and the fallback to IE, and its point to the error log, to which an error is posted that also contains a link to FAQ. This makes it possible to easily copy the link, which is not possible from the message box (or maybe someone knows how to easily implement that).
Fixes #2000
Supercedes and thus closes #2038
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:
Screenshots
The dialog popping up:

The event log entry:

How to test
If you want to test the change, it's easiest to force Edge to throw the error as if it was thrown when the runtime is missing.
To this end, you can add the following to the
Edge::create(Composite, int)
method: