Repository navigation
Conversation
iOS WebKit (every iOS browser and installed PWAs) ignores the download attribute of data: urls and only shows the file as text. The _download event turns a data: url into a blob: url and attaches the link to the document before clicking it.
b4b8c75 to
f335b00
Compare
[Medium impact] The PR appears safe to merge. SummaryMakes inline
Reviews (5) · Last reviewed commit: "Merge branch 'download-blob-url-exact-ur..." · Reviewed by Greptile |
Merging this PR will not alter performance1 warning
Comparing |
A connect-src policy that does not allow data: urls blocks fetching one, so the _download event decodes the base64 or percent-encoded data itself before building the blob: url.
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…load like fetch A data: url handed to rx.download through a Var is passed on unchanged and may carry a fragment or percent-encode its base64 body. Drop the fragment and percent-decode the body before base64-decoding it, as the data url processor does.
|
@codspeedbot fix this regression |
|
The CodSpeed regression in test_route_matching[100] (−5.9%) is unrelated to this change: the PR only touches state.js, an integration test and a news fragment, none of which run in that benchmark. It matches the flaky ±5.5–5.9% swings of route_matching that #7878 describes, which come from the benchmark measuring a few lru_cache hits |
iOS WebKit (Safari, every other iOS browser and installed PWAs) ignores the
downloadattribute ofdata:urls and only displays the file instead of saving it.rx.download(data=...)always produces adata:url, so it never saves a file on iOS.The
_downloadevent now turns adata:url into ablob:url before clicking the link, and attaches the link to the document first. Downloads of regular urls are unchanged.Tests: a Playwright test downloads inline text from a frontend event and bytes from a backend event and asserts the blob url, file name and exact content. It fails without the fix.