Revision: 29571
          http://sourceforge.net/p/bibdesk/svn/29571
Author:   hofman
Date:     2025-09-11 14:11:30 +0000 (Thu, 11 Sep 2025)
Log Message:
-----------
download from legacy webview for form submit and content-disposition attachment

Modified Paths:
--------------
    trunk/bibdesk/BDSKWebView.m

Modified: trunk/bibdesk/BDSKWebView.m
===================================================================
--- trunk/bibdesk/BDSKWebView.m 2025-09-10 14:44:31 UTC (rev 29570)
+++ trunk/bibdesk/BDSKWebView.m 2025-09-11 14:11:30 UTC (rev 29571)
@@ -523,6 +523,14 @@
 
 #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"]) {
+        [listener download];
+    } else {
+        [listener use];
+    }
+}
+
 - (void)webView:(WebView *)sender decidePolicyForMIMEType:(NSString *)type 
request:(NSURLRequest *)request frame:(WebFrame *)frame 
decisionListener:(id<WebPolicyDecisionListener>)listener {
     if ([WebView canShowMIMEType:type])
         [listener use];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to