Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] File download works in Safari but does not work in Tauri on Mac #8452

Closed
kirill-konshin opened this issue Dec 20, 2023 · 2 comments
Closed
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@kirill-konshin
Copy link

Describe the bug

Simple code to download as Blob does not work in Tauri, but works in Safari.

No dialog window to save file is shown, no errors in console.

I also tried file-saver NPM package, got error: top frame not allowed to naigate to data URL (also works well in Safari).

Safari version 17.1.2 (19616.2.9.11.12).

Reproduction

    const element = document.createElement("a");
    element.setAttribute("href", URL.createObjectURL(new Blob([text], { type: mimeType })));
    element.setAttribute("download", filename);

    element.style.display = "none";
    document.body.appendChild(element);

    element.click();

    document.body.removeChild(element);

Expected behavior

File download dialog.

Full tauri info output

[⚠] Environment
    - OS: Mac OS 14.1.2 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.74.0 (79e9716c9 2023-11-13) (Homebrew)
    ✔ cargo: 1.74.0
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be detected!
      Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 21.5.0
    - yarn: 4.0.2
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 1.5.3
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.6
    - tao [RUST]: 0.16.5
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.5.9

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: public
    - devPath: http://localhost:3000/

Stack trace

No response

Additional context

No response

@kirill-konshin kirill-konshin added status: needs triage This issue needs to triage, applied to new issues type: bug labels Dec 20, 2023
@kirill-konshin
Copy link
Author

Found article https://davelage.com/posts/tauri-save-files/ which says "Possibly there will be APIs that allow this to happen through the browser interface in the future." — PR tauri-apps/wry#530 has been merged, but looks like not yet supported.

@FabianLars
Copy link
Member

Duplicate of #4633 - thanks for reaching out :)

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants