Revision: 29497
          http://sourceforge.net/p/bibdesk/svn/29497
Author:   hofman
Date:     2025-08-29 15:42:11 +0000 (Fri, 29 Aug 2025)
Log Message:
-----------
use whole request to download

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

Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m    2025-08-29 09:23:29 UTC (rev 
29496)
+++ trunk/bibdesk/BDSKTextImportController.m    2025-08-29 15:42:11 UTC (rev 
29497)
@@ -1032,7 +1032,8 @@
 }
 
 - (WKWebView *)webView:(WKWebView *)aWebView 
createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration 
forNavigationAction:(WKNavigationAction *)navigationAction 
windowFeatures:(WKWindowFeatures *)windowFeatures {
-    NSURL *url = [[navigationAction request] URL];
+    NSURLRequest *request = [navigationAction request];
+    NSURL *url = [request URL];
     
     if (customMenuAction == BDSKWebViewCustomMenuActionOpenLink) {
         [[NSWorkspace sharedWorkspace] openURLWithDefaultApp:url];
@@ -1045,12 +1046,12 @@
             [[self publication] addFileForURL:url autoFile:YES 
runScriptHook:NO];
         [[self undoManager] setActionName:NSLocalizedString(@"Edit 
Publication", @"Undo action name")];
     } else if (customMenuAction == BDSKWebViewCustomMenuActionDownloadLink) {
-        if (isDownloading)
+        if (isDownloading) {
+            NSBeep();
             return nil;
-        if (url) {
-            download = [[BDSKDownloader sharedDownloader] 
startFileDownloadWithRequest:[NSURLRequest requestWithURL:url] delegate:self];
-            [self setDownloading:YES];
         }
+        download = [[BDSKDownloader sharedDownloader] 
startFileDownloadWithRequest:request delegate:self];
+        [self setDownloading:YES];
         if (download == nil) {
             NSAlert *alert = [[NSAlert alloc] init];
             [alert setMessageText:NSLocalizedString(@"Invalid or Unsupported 
URL", @"Message in alert dialog when unable to download file for Local-Url")];

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

Reply via email to