question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SaveFilePickerAsync is broken on wasm firefox

See original GitHub issue

Describe the bug An error occur whenever I try to call the SaveFilePicker on Firefox because it uses an api that is not supported on that browser.

To Reproduce Steps to reproduce the behavior:

  1. Have a SaveFilePickerAsync call in your app
  2. Observe the following error in the console with no dialog: Screenshot from 2023-04-20 03-07-11

Expected behavior The SaveFilePickerAsync to work correctly on Firefox.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Firefox 111.0.1
  • Version 11 preview 6

Additional context Essentially, I investigated myself and found this line https://github.com/AvaloniaUI/Avalonia/blob/master/src/Browser/Avalonia.Browser/webapp/modules/storage/storageProvider.ts#L50 which seemed to call a function on the window, but in checking the mdn documention, if you scroll down at the end, it specifically says that Firefox has “No Support”: https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker#browser_compatibility

I currently have issues to test on my end, but the native-file-system-adapter module does seem to provide a showSaveFilePicker which could fix this problem. I wonder why this feature was used considering Firefox doesn’t support it.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
maxkatz6commented, Apr 21, 2023

@aldelaro5 to save the file in a conventional way, you convert a file into encoded URI, which is later can be downloaded from a fake <a> link. See https://stackoverflow.com/questions/35038884/download-file-from-bytes-in-javascript This is probably the best way, if your files aren’t too big (i.e., less than gigabytes).

0reactions
maxkatz6commented, May 11, 2023

Also, how did you got the ControlCatalog project running

dotnet run

See, the problem is it’s not actually downloading anything.

Well, I just tried in Firefox and it just works. At least how it’s expected from polyfil. Probably can you try to find any logs or debug JS code in your browser? Browser devtools are quite powerful. Also Firefox should automatically use readable TypeScript code when you set breakpoints in the browser. Debugging JS from VS/Rider is a pain.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to show File Picker | Firefox Support Forum
This was going to be a question about Firefox being unable to display the file picker dialog, but I managed to find a...
Read more >
WebAssembly.LinkError() constructor - MDN Web Docs - Mozilla
The WebAssembly.LinkError() constructor creates a new WebAssembly LinkError object, which indicates an error during module instantiation ...
Read more >
Security Vulnerabilities fixed in Firefox 116
An out-of-bounds read could have led to an exploitable crash when parsing HTML with DOMParser in low memory situations. References. Bug 1841368 ......
Read more >
Firefox for Android doesn't load webassembly
I'm programming a webassembly site (http://ictz.net) with .Net Core & Blazor.net. It does load in Firefox for Windows not in Firefox for ...
Read more >
Firefox pdf.js not working with clippers
Hello! I'm using firefox dev edition, both Mendeley and Evernote addons have stopped working with PDF files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found