Skip to content

Commit 6509979

Browse files
amartya4256HeikoKlare
authored andcommitted
Allow to configure Edge userdata directory via Display data
With this contribution, a custom userdata directory can provided to Edge browser via its Display for the separation of the usage of userdata directory per application by the webview2Environment. contributes to #1013
1 parent 69d16e9 commit 6509979

File tree

1 file changed

+4
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser

1 file changed

+4
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class Edge extends WebBrowser {
3939
static final String SDK_TARGET_VERSION = "99.0.1150.38";
4040

4141
// Display.getData() keys
42+
static final String EDGE_USER_DATA_FOLDER = "org.eclipse.swt.internal.win32.edgeUserDataFolder";
4243
static final String APPLOCAL_DIR_KEY = "org.eclipse.swt.internal.win32.appLocalDir";
4344
static final String EDGE_USE_DARK_PREFERED_COLOR_SCHEME = "org.eclipse.swt.internal.win32.Edge.useDarkPreferedColorScheme"; //$NON-NLS-1$
4445

@@ -476,6 +477,9 @@ WebViewEnvironment createEnvironment() {
476477
String dataDir = System.getProperty(DATA_DIR_PROP);
477478
String browserArgs = System.getProperty(BROWSER_ARGS_PROP);
478479
String language = System.getProperty(LANGUAGE_PROP);
480+
if (dataDir == null) {
481+
dataDir = (String) display.getData(EDGE_USER_DATA_FOLDER);
482+
}
479483
if (dataDir == null) {
480484
// WebView2 will append "\\EBWebView"
481485
dataDir = (String)display.getData(APPLOCAL_DIR_KEY);

0 commit comments

Comments
 (0)