Skip to content

Commit 97855ad

Browse files
committed
[Edge] Improve dialog when WebView2 engine is not available #2035
When a browser is opened and the WebView2 engine used as default is not available, a dialog pops up with additional information and the ability to switch back to the Internet Explorer for the current application session. By now, the dialog lacked the information that the switch to the Internet Explorer is not permanent. In addition, it was not possible to disable that dialog, e.g., for scenarios in which an application is executed in some automation and such a popup blocks automated processes. This change adapts the dialog message to clarify that the switch to Internet Explorer will lose its effect on next application start and refers to the information link which gives more insights on how to permanently switch back to Internet Explorer. In addition, it adds a system property to disable that dialog. Contributes to #2035
1 parent 2ac9121 commit 97855ad

File tree

1 file changed

+5
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser

1 file changed

+5
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public class Browser extends Composite {
5656
static final String PACKAGE_PREFIX = "org.eclipse.swt.browser."; //$NON-NLS-1$
5757
static final String PROPERTY_DEFAULTTYPE = "org.eclipse.swt.browser.DefaultType"; //$NON-NLS-1$
5858

59+
static final String WEBIEW_UNAVAILABLE_DISABLED = "org.eclipse.swt.browser.DisableWebViewUnavailableDialog"; //$NON-NLS-1$
60+
5961
/**
6062
* Constructs a new instance of this class given its parent
6163
* and a style value describing its behavior and appearance.
@@ -144,7 +146,7 @@ private record DialogOption(int index, String message) {};
144146
private static final DialogOption CANCEL_OPTION = new DialogOption(SWT.CANCEL, "Cancel");
145147

146148
private static final String DIALOG_TITLE = "Default browser engine not available";
147-
private static final String DIALOG_MESSAGE = "Microsoft Edge (WebView2) is not available. Do you want to use the legacy Internet Explorer?\n\nNote: It is necessary to reopen browsers for the change to take effect.";
149+
private static final String DIALOG_MESSAGE = "Microsoft Edge (WebView2) is not available. Do you want to use the legacy Internet Explorer?\n\nNote: It is necessary to reopen browsers for the change to take effect and the effect will be lost at next application start. For information on how to permanently switch to Internet Explorer, press the \"Information\" button.";
148150
private static final String FAQ_URL = "https://github.com/eclipse-platform/eclipse.platform/tree/master/docs/FAQ/FAQ_How_do_I_use_Edge-IE_as_the_Browser's_underlying_renderer.md";
149151

150152
private static final int DIALOG_OPTION_FLAGS = USE_IE_OPTION.index | MORE_INFORMATION_OPTION.index | CANCEL_OPTION.index;
@@ -156,7 +158,8 @@ private record DialogOption(int index, String message) {};
156158
private static boolean shownOnce;
157159

158160
static void showAsync(Shell parentShell) {
159-
if (shownOnce) {
161+
if (shownOnce || Boolean.getBoolean(WEBIEW_UNAVAILABLE_DISABLED)) {
162+
shownOnce = true;
160163
return;
161164
}
162165
shownOnce = true;

0 commit comments

Comments
 (0)