dataDirectorySuffix property

String? dataDirectorySuffix
getter/setter pair

The directory name suffix to be used for the current process. Must not contain a path separator and should not be empty.

Define the directory used to store WebView data for the current process. The provided suffix will be used when constructing data and cache directory paths. If this API is not called, no suffix will be used. Each directory can be used by only one process in the application. If more than one process in an app wishes to use WebView, only one process can use the default directory, and other processes must call this API to define a unique suffix.

This means that different processes in the same application cannot directly share WebView-related data, since the data directories must be distinct. Applications that use this API may have to explicitly pass data between processes. For example, login cookies may have to be copied from one process's cookie jar to the other using PlatformCookieManager if both processes' WebViews are intended to be logged in.

Most applications should simply ensure that all components of the app that rely on WebView are in the same process, to avoid needing multiple data directories. The PlatformInAppWebViewController.disableWebView method can be used to ensure that the other processes do not use WebView by accident in this case.

NOTE: available only if WebViewFeature.STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX feature is supported.

Implementation

String? dataDirectorySuffix;