diff --git a/crates/tauri-runtime-cef/src/cef_impl.rs b/crates/tauri-runtime-cef/src/cef_impl.rs index 656d06787..f31645688 100644 --- a/crates/tauri-runtime-cef/src/cef_impl.rs +++ b/crates/tauri-runtime-cef/src/cef_impl.rs @@ -726,7 +726,7 @@ wrap_download_handler! { .map(std::path::PathBuf::from) .unwrap_or_default(); - let mut destination = suggested_path; + let mut destination = suggested_path.clone(); // Call handler with Requested event let should_allow = (self.download_handler)(tauri_runtime::webview::DownloadEvent::Requested { @@ -737,7 +737,10 @@ wrap_download_handler! { if should_allow { // Set the download path let destination_cef = CefStringUtf16::from(destination.to_string_lossy().as_ref()); - callback.cont(Some(&destination_cef), 0); + + // if the user callback did not modify the destination, show the dialog + let show_dialog = destination == suggested_path; + callback.cont(Some(&destination_cef), show_dialog as ::std::os::raw::c_int); } 1 }