From b6a2cd4eb0a6bf7bf2a8c4aff3ce502221ce5302 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Tue, 2 Dec 2025 14:56:08 -0500 Subject: [PATCH] Whats New page use non-persistent data store This prevents leaving behind stale files in misc folders in ~/Library (WebKit/org.vim.MacVim, Caches/org.vim.MacVim/WebKit, HTTPStorages/org.vim.MacVim). In general we don't need to store any persistent data or cookies for the What's New page and we want to make it easy to uninstall MacVim. --- src/MacVim/MMWhatsNewController.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/MacVim/MMWhatsNewController.m b/src/MacVim/MMWhatsNewController.m index 4000d13df4..728c0b40b6 100644 --- a/src/MacVim/MMWhatsNewController.m +++ b/src/MacVim/MMWhatsNewController.m @@ -118,10 +118,19 @@ - (void)windowDidLoad messageTextField.stringValue = @""; } + WKWebViewConfiguration *config = [[[WKWebViewConfiguration alloc] init] autorelease]; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11 + if (AVAILABLE_MAC_OS(10, 11)) { + // Don't leave stale files in user's Library + config.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore]; + } +#endif + // Construct a web view at runtime instead of relying on using the xib because this is // more backwards compatible as we can use runtime checks and compiler defines. _webView = [[WKWebView alloc] initWithFrame:NSZeroRect - configuration:[[[WKWebViewConfiguration alloc] init] autorelease]]; + configuration:config]; [webViewContainer addSubview:_webView]; _webView.frame = webViewContainer.bounds;