Skip to content
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

Allow to configure Edge userdata directory via Display data #1548

Conversation

amartya4256
Copy link
Contributor

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.

Depends on eclipse-platform/eclipse.platform.ui#2434

contributes to #1013

@iloveeclipse
Copy link
Member

I'm not sure if workspace is the right place for user data of Edge browser that can be used on workspace free RCP applications.

Copy link
Contributor

github-actions bot commented Oct 21, 2024

Test Results

   483 files  ±0     483 suites  ±0   8m 26s ⏱️ +6s
 4 095 tests ±0   4 085 ✅ ±0   7 💤 ±0  3 ❌ ±0 
16 173 runs  ±0  16 080 ✅ ±0  90 💤 ±0  3 ❌ ±0 

For more details on these failures, see this check.

Results for commit 712bd2a. ± Comparison against base commit 6a2d73f.

♻️ This comment has been updated with latest results.

@HeikoKlare
Copy link
Contributor

I'm not sure if workspace is the right place for user data of Edge browser that can be used on workspace free RCP applications.

I would rather propose to use the workspace directory whenever there is such a directory and in other cases use a different one (probably the ordinary user-data folder as used now).

In addition, SWT should not depend on the concept of a "workspace URL". There should rather be some "custom edge data folder", "display-specific edge data folder" or the like instead. Also, we cannot replace the usage of the existing system property, because people may still want to use that opportunity (in particular in plain SWT applicationS).

So what about using these values in decreasing preference:

  • Use the value of the existing system property if provided?
  • Use a value for some "custom edge data directory" defined as data in the display if specified (which can then be used by the Eclipse platform to define some specific value, may it workspace-dependent or not).
  • Use the default value.

@laeubi
Copy link
Contributor

laeubi commented Oct 21, 2024

I'm not sure what the edge user data directory is actually storing, but from OSGi perspective there is

https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Bundle.html#getDataFile-java.lang.String-

@akurtakov
Copy link
Member

I'm not sure what the edge user data directory is actually storing, but from OSGi perspective there is

https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Bundle.html#getDataFile-java.lang.String-

SWT should stay usable in non-OSGi environment too.

@fedejeanne fedejeanne linked an issue Oct 25, 2024 that may be closed by this pull request
@amartya4256 amartya4256 force-pushed the edge_use_workspace_for_userdata branch 2 times, most recently from 864b5d0 to f232fd7 Compare October 25, 2024 10:25
@laeubi
Copy link
Contributor

laeubi commented Oct 26, 2024

I'm not sure what the edge user data directory is actually storing, but from OSGi perspective there is
https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/Bundle.html#getDataFile-java.lang.String-

SWT should stay usable in non-OSGi environment too.

As far as I understand the settings/property is setup by the one who creates the display, so at that point OSGI might or might not be used.

Beside that, such thing can even be crafted in a way that is opaque for non-OSGi users, e.g with having an activator that initializes a static field, in non-OSGi env this will simply not happen and any default can be used instead.

@HeikoKlare HeikoKlare force-pushed the edge_use_workspace_for_userdata branch 2 times, most recently from c211330 to 6509979 Compare October 28, 2024 10:40
@HeikoKlare HeikoKlare changed the title Use Workspace directory for usedata directory Allow to configure Edge userdata directory via Display data Oct 28, 2024
Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HeikoKlare I extracted the method getDataDir(Display) and pushed the changes.

@HeikoKlare HeikoKlare force-pushed the edge_use_workspace_for_userdata branch 2 times, most recently from 41e12c2 to 27529f9 Compare October 28, 2024 12:00
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
eclipse-platform#1013
@HeikoKlare HeikoKlare force-pushed the edge_use_workspace_for_userdata branch from 27529f9 to 712bd2a Compare October 28, 2024 12:47
@HeikoKlare
Copy link
Contributor

Test failures are unrelated and already documented:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants