userDataFolder property
You may specify the userDataFolder to change the default user data folder location for WebView2.
The path is either an absolute file path or a relative file path that is interpreted as relative
to the compiled code for the current process.
For UWP apps, the default user data folder is the app data folder for the package.
For non-UWP apps, the default user data ({Executable File Name}.WebView2
) folder
is created in the same directory next to the compiled code for the app.
WebView2 creation fails if the compiled code is running in a directory in which the
process does not have permission to create a new directory.
The app is responsible to clean up the associated user data folder when it is done.
NOTE: As a browser process may be shared among WebViews,
WebView creation fails with HRESULT_FROM_WIN32(ERROR_INVALID_STATE)
if the specified
options does not match the options of the WebViews that are currently
running in the shared browser process.
Officially Supported Platforms/Implementations:
Implementation
final String? userDataFolder;