Revision: 29572
http://sourceforge.net/p/bibdesk/svn/29572
Author: hofman
Date: 2025-09-11 14:15:32 +0000 (Thu, 11 Sep 2025)
Log Message:
-----------
it is probably not a good idea to always download on form submit
Modified Paths:
--------------
trunk/bibdesk/BDSKTextImportController.m
trunk/bibdesk/BDSKWebView.m
Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m 2025-09-11 14:11:30 UTC (rev
29571)
+++ trunk/bibdesk/BDSKTextImportController.m 2025-09-11 14:15:32 UTC (rev
29572)
@@ -966,11 +966,11 @@
- (void)webView:(WKWebView *)aWebView
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
preferences:(WKWebpagePreferences *)preferences decisionHandler:(void
(^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler
API_AVAILABLE(macos(10.15)) {
if (@available(macOS 11.3, *)) {
- if ([navigationAction shouldPerformDownload] || [navigationAction
navigationType] == WKNavigationTypeFormSubmitted)
+ if ([navigationAction shouldPerformDownload])
decisionHandler(WKNavigationActionPolicyDownload, preferences);
else
decisionHandler(WKNavigationActionPolicyAllow, preferences);
- } else if ([navigationAction navigationType] ==
WKNavigationTypeFormSubmitted || [[[navigationAction request]
valueForHTTPHeaderField:@"Content-Disposition"] hasPrefix:@"attachment"]) {
+ } else if ([[[navigationAction request]
valueForHTTPHeaderField:@"Content-Disposition"] hasPrefix:@"attachment"]) {
NSURLRequest *request = [navigationAction request];
BDSKDownload *aDownload = [[BDSKDownloader sharedDownloader]
startFileDownloadWithRequest:request delegate:[[BDSKDownloadManager
sharedManager] bdskDownloadDelegate]];
[[BDSKDownloadManager sharedManager] addDownload:aDownload
request:request];
Modified: trunk/bibdesk/BDSKWebView.m
===================================================================
--- trunk/bibdesk/BDSKWebView.m 2025-09-11 14:11:30 UTC (rev 29571)
+++ trunk/bibdesk/BDSKWebView.m 2025-09-11 14:15:32 UTC (rev 29572)
@@ -524,7 +524,7 @@
#pragma mark WebPolicyDelegate protocol
- (void)webView:(WebView *)sender
decidePolicyForNavigationAction:(NSDictionary *)actionInformation
request:(NSURLRequest *)request frame:(WebFrame *)frame
decisionListener:(id<WebPolicyDecisionListener>)listener {
- if ([[actionInformation objectForKey:WebActionNavigationTypeKey]
integerValue] == WebNavigationTypeFormSubmitted || [[request
valueForHTTPHeaderField:@"Content-Disposition"] hasPrefix:@"attachment"]) {
+ if ([[request valueForHTTPHeaderField:@"Content-Disposition"]
hasPrefix:@"attachment"]) {
[listener download];
} else {
[listener use];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit