Skip to content

Commit

Permalink
Use Workspace directory for usedata directory
Browse files Browse the repository at this point in the history
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
  • Loading branch information
amartya4256 committed Oct 25, 2024
1 parent 209d75a commit 864b5d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Edge extends WebBrowser {
*/
private static final URI URI_FOR_CUSTOM_TEXT_PAGE = setupAndGetLocationForCustomTextPage();
private static final String ABOUT_BLANK = "about:blank";
private static final String WORKSPACE_URL = "workspaceUrl";

private record WebViewEnvironment(ICoreWebView2Environment environment, ArrayList<Edge> instances) {
public WebViewEnvironment(ICoreWebView2Environment environment) {
Expand Down Expand Up @@ -476,6 +477,9 @@ WebViewEnvironment createEnvironment() {
String dataDir = System.getProperty(DATA_DIR_PROP);
String browserArgs = System.getProperty(BROWSER_ARGS_PROP);
String language = System.getProperty(LANGUAGE_PROP);
if (dataDir == null) {
dataDir = (String) browser.getDisplay().getData(WORKSPACE_URL);
}
if (dataDir == null) {
// WebView2 will append "\\EBWebView"
dataDir = (String)display.getData(APPLOCAL_DIR_KEY);
Expand Down

0 comments on commit 864b5d0

Please sign in to comment.