Skip to content

Use FileSaver.js on WASM - #268

Closed
dolezvo1 wants to merge 2 commits into
PolyMeilex:masterfrom
dolezvo1:master
Closed

Use FileSaver.js on WASM#268
dolezvo1 wants to merge 2 commits into
PolyMeilex:masterfrom
dolezvo1:master

Conversation

@dolezvo1

@dolezvo1 dolezvo1 commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Use FileSaver.js on WASM to allow for default file names on "recent" versions of all major browsers (see supported browsers). I think it is related to what #128 is asking for.

@dolezvo1 dolezvo1 mentioned this pull request Oct 18, 2025
@PolyMeilex

Copy link
Copy Markdown
Owner

Look promising, thanks!

But the UX seems to be broken after this change, the popup no longer serves any purpose as far as I can tell, shouldn't we remove it?

Firefox:

Screencast.From.2025-10-18.17-21-42.mp4

Chrome:

Screencast.From.2025-10-18.17-22-21.mp4

@dolezvo1

Copy link
Copy Markdown
Contributor Author

I think it could be removed, but if I understand correctly, FileSaver.js doesn't really support cancellation. I wasn't sure to what extent is cancellation necessary, so I didn't touch the rest of the code.

@PolyMeilex

Copy link
Copy Markdown
Owner

It's fine we don't need cancellation, from what I've seen most people were not fans of the popup existence anyway.

@dolezvo1

dolezvo1 commented Oct 18, 2025

Copy link
Copy Markdown
Contributor Author

Now that I think about it, I think the alternative to removing it could be adding download button that would allow for triggering the download multiple times, similar to how the link worked up until this. I'm not sure what is the situation with WebKit (with downloads not being triggered outside of input handling) at the moment, but presumably better to err on the side of safety.

@PolyMeilex

Copy link
Copy Markdown
Owner

Now that I think about it, I think the alternative to removing it could be adding download button that would allow for triggering the download multiple times, similar to how the link worked up until this.

Sure, that's also fine by me. Having a button also makes sure that we will be called from a click-handler, which as you mentioned can sometimes be mandatory.

@dolezvo1

Copy link
Copy Markdown
Contributor Author

Awesome, I'll try to do it as soon as possible. Thanks for taking a look!

@dolezvo1

Copy link
Copy Markdown
Contributor Author

Could you check if this works?

@PolyMeilex

Copy link
Copy Markdown
Owner

Works fine now.

Can you also say which browser it actually fixes?
File names in Firefox 143.0.4 and Chrome 141.0.7390.107 both work fine for me on rfd master.

@dolezvo1

Copy link
Copy Markdown
Contributor Author

Oh, I was operating under the assumption that it didn't, but you're right. I think that means the documentation for AsyncFileDialog is wrong, though.

@dolezvo1 dolezvo1 closed this Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants