Skip to content

Commit b6a2cd4

Browse files
committed
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.
1 parent 53c1775 commit b6a2cd4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/MacVim/MMWhatsNewController.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,19 @@ - (void)windowDidLoad
118118
messageTextField.stringValue = @"";
119119
}
120120

121+
WKWebViewConfiguration *config = [[[WKWebViewConfiguration alloc] init] autorelease];
122+
123+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11
124+
if (AVAILABLE_MAC_OS(10, 11)) {
125+
// Don't leave stale files in user's Library
126+
config.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
127+
}
128+
#endif
129+
121130
// Construct a web view at runtime instead of relying on using the xib because this is
122131
// more backwards compatible as we can use runtime checks and compiler defines.
123132
_webView = [[WKWebView alloc] initWithFrame:NSZeroRect
124-
configuration:[[[WKWebViewConfiguration alloc] init] autorelease]];
133+
configuration:config];
125134

126135
[webViewContainer addSubview:_webView];
127136
_webView.frame = webViewContainer.bounds;

0 commit comments

Comments
 (0)