Repository navigation
feat(frontend): save the installer in browsers without a file picker - #2
Merged
Merged
Conversation
Firefox, Safari and Brave have no showSaveFilePicker, so the page stopped at "This browser is not supported". There the .run now goes out as an ordinary download: header, meta and the archive in one Blob, the archive as the File itself, which a Blob keeps as a reference to the disk, so it is never read into memory. Chrome and Edge keep the picker: it puts the file straight onto a USB stick or another drive, and the page follows the progress. Verified on the built site with a 5 GiB Zip64 archive: Firefox 157 downloaded it in 27 s and grew by 54 MiB with three such downloads at once, and Chromium 156 without the picker, as in Brave, took 15 s. GNU dd and tar read meta out of the .run, and the archive in it matched the original byte for byte. Safari is not verified. Without the picker the build panel shows no progress, since the browser does, and says the browser is downloading the file. The warning about free space is shown only where the picker is: elsewhere navigator.storage.estimate() is the quota of the site, which Firefox 157 put at 7.4 GiB on a disk with 51 GB free. CanSaveFiles$ becomes HasSavePicker$, and the download itself is the new download service.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Firefox, Safari and Brave have no
showSaveFilePicker(Brave switches it off), so the page stopped at "This browser is not supported". SPEC §8 gave the reason as aBlobcapped at ~1-2 GB, but that cap is about aBlobbuilt from bytes in memory. The.runis the header, meta and the archive byte for byte, and aBlobkeeps aFileamong its parts as a reference to the disk: the download reads the archive from disk as it goes and never holds it in memory.What
Build$puts the header, meta and the archiveFileinto oneBlob(runBlobinservices/bundle) and hands it to the browser through a link withdownload(startDownloadin the newservices/download).Blobis let go at the next build or when the archive changes, not right after the click. A download already under way goes on without it.Downloadingstory shows it.UnsupportedBrowserstory.navigator.storage.estimate()is the quota of the site, which Firefox 157 put at 7.4 GiB on a disk with 51 GB free.CanSaveFiles$becomesHasSavePicker$: every browser can save now, and the token says how.Notes
ddandtarread meta out of the.runby its own header, and the archive in it matched the original byte for byte. Chromium 156 with the picker removed, as in Brave, did the same in 15 s.editorconfig-checkerv4.0.2 finds no errors.