fix: set WebKitGTK WebsiteDataManager's base_cache_directory (#1547)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
Youn Mélois
2026-01-15 14:21:42 +01:00
committed by GitHub
parent fd0ccdc94c
commit 4fcff147b5
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
"wry": patch
---
Set `WebsiteDataManagerBuilder::base_cache_directory` with the same path as `base_data_directory`.
This change allows the cache directory to be changed instead of using the default one [from WebKitGTK](https://webkitgtk.org/reference/webkit2gtk/stable/property.WebsiteDataManager.base-cache-directory.html).

View File

@@ -34,6 +34,8 @@ impl WebContextImpl {
let mut context_builder = WebContext::builder();
if let Some(data_directory) = data_directory {
let data_manager = WebsiteDataManager::builder()
// TODO: Consider taking a cache_directory so this can be in XDG_CACHE_HOME.
.base_cache_directory(data_directory.to_string_lossy())
.base_data_directory(data_directory.to_string_lossy())
.build();
if let Some(cookie_manager) = data_manager.cookie_manager() {