Skip to content

Commit f232fd7

Browse files
committed
Use Workspace directory for usedata directory
With this contribution, Edge browser uses the workspace directory for the userdata directory for the separation of the usage of userdata directory per workspace by the webview2Environment. contributes to #1013
1 parent 209d75a commit f232fd7

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
@@ -55,6 +55,7 @@ class Edge extends WebBrowser {
5555
*/
5656
private static final URI URI_FOR_CUSTOM_TEXT_PAGE = setupAndGetLocationForCustomTextPage();
5757
private static final String ABOUT_BLANK = "about:blank";
58+
private static final String DISPLAY_USER_DATA_FOLDER = "displayUserDataFolder";
5859

5960
private record WebViewEnvironment(ICoreWebView2Environment environment, ArrayList<Edge> instances) {
6061
public WebViewEnvironment(ICoreWebView2Environment environment) {
@@ -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) browser.getDisplay().getData(DISPLAY_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)