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

wxWebViewEdge - user data folder #19317

Closed
wxtrac opened this issue Nov 11, 2021 · 0 comments
Closed

wxWebViewEdge - user data folder #19317

wxtrac opened this issue Nov 11, 2021 · 0 comments

Comments

@wxtrac
Copy link
Collaborator

wxtrac commented Nov 11, 2021

Issue migrated from trac ticket # 19317

component: WebView | priority: normal | keywords: wxWebViewEdge

2021-11-11 12:03:38: rk (Ronny Krueger) created the issue


WebView2 allows to specify a user data folder where the component will "store browser data, such as cookies, permissions, and cached resources" (see here for more details).

The folder that the backend currently uses is hard-coded to wxStandardPaths::Get().GetUserLocalDataDir(). I see a couple of problems with that:

  • There is only one folder per application which means that all data is shared between application instances. This is a good default but might be a problem with advanced use cases.
  • According to the documentation (see above link) the application is responsible for this folder. But right now it is not possible to get this path without looking into the source code. Also, the used path is the user's local data directory itself (not a sub directory inside of it). This makes it quite hard if you want to delete the WebView2 data without accidentally deleting any other data that could have been put there.

I think the easiest way to fix this would be extending wxWebViewEdge with MSWSetUserDataDir() and MSWGetUserDataDir() methods that allow to specify and query the user data path from the application code.

One problem I see is that technically WebView2 allows to specify a different user data path for each instance. If wx wants to support this it would mean that this path cannot simply be a static variable in the backend but must be passed to and saved inside the wxWebViewEdge instance.

TcT2k added a commit to TcT2k/wxWidgets that referenced this issue Mar 17, 2023
While currently only implemented for the Edge backend GTK webkit could
also make use of such a setting.

Fixes: wxWidgets#19317
@vadz vadz closed this as completed in b48e5b4 Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant