Nw.js: <a> "download" attribute doesn't seem to work

Created on 11 Aug 2017  Â·  9Comments  Â·  Source: nwjs/nw.js

Read the following before submitting your issue, thank you.

Issues meet the checklist above will be processed before those don't.

P2 bug documentation triaged

All 9 comments

I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.24.2.

I'm glad to see activity on the thread and you have been able to reproduce the problem :).
For now, I still didn't find a way to download a blob/arraybuffer with a predefined filename inside my app.
Thanks for your amazing work guys!

@Christywl I can't reproduce this with latest 0.25 nightly build. Please try again.

@rogerwang , it still doesn't work for me with https://dl.nwjs.io/live-build/09-04-2017/nw25-38856f7-dcf9601-90dc2ed-c48782d/v0.25.0/nwjs-sdk-v0.25.0-win-x64.zip. My codes:

<!DOCTYPE html>
<html>
<body>
<p>Click to download:<p>
<a href="https://www.w3schools.com/jsref/horse.mp3" download="test">horse.mp3 download</a>
</body>
</html>

image

Is there something wrong in my test?

Maybe it's because I was trying with Linux ... Thanks.

On Mon, Sep 4, 2017 at 3:32 PM Christywl notifications@github.com wrote:

It still doesn't work for me with
https://dl.nwjs.io/live-build/09-04-2017/nw25-38856f7-dcf9601-90dc2ed-c48782d/v0.25.0/nwjs-sdk-v0.25.0-win-x64.zip.
My codes:




Click to download:


horse.mp3 download

[image: image]
https://user-images.githubusercontent.com/20039821/30016089-33a1a7be-9186-11e7-8678-69c6cfbab830.png

Is there something wrong in my test?

—
You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub
https://github.com/nwjs/nw.js/issues/6094#issuecomment-326887129, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGaZcPzk-KEegGxDdXnSkiGMiLRiQks5se6eJgaJpZM4O1LTu
.

I got the same result on Linux with v0.25.0, the file name didn't change.

This is because I was testing with a http URL as the start page, and it's in the spec that the attribute should be dropped when requesting cross-origin downloads: https://bugs.chromium.org/p/chromium/issues/detail?id=714373

So this is expected and not a bug. However, the cross-origin limit should be lifted in NW.js app as we are not using W3C security model in NW.js frames.

This is fixed in git and will be available in the next nightly build.

Was this page helpful?
0 / 5 - 0 ratings