-
Notifications
You must be signed in to change notification settings - Fork 473
Unable to download data: urls #6314
Comments
@snorp says this should be handled in AC itself |
Yeah, data URLs are pretty straightforward, so you don't need GV to do anything for you. The MDN page should have everything you need here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs |
@snorp @agi90 We could add support for data URIs ourselves, yes. Just figured we'd want the same solution/API as for However, I would still need If so, I can file that separately. |
6475: Closes #6314: Support fetching / downloading data URIs r=Amejia481,pocmo a=csadilek With this we can fetch from data URIs and downloads "just work" (we don't require any special handling). So, e.g. this works now (which is also used by uBlock to save backups): ```html <a href="data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==" download="backup.txt">Backup</a> ``` https://github.com/gorhill/uBlock/blob/08d370d32e648c2823e1bc31fcd9f7e1f96d155a/platform/chromium/vapi-common.js#L172 GV didn't want to add API for it so I took a stab at adding this to our fetch libs: #6314 (comment) @pocmo can you take a look since we looked at download stuff today :). I've time-boxed this and limited to base64 encoded URIs. The device and unit tests pass and the download works / can be tested here: https://jsfiddle.net/nue9rg0L/2/ Co-authored-by: Christian Sadilek <[email protected]>
6475: Closes #6314: Support fetching / downloading data URIs r=Amejia481,pocmo a=csadilek With this we can fetch from data URIs and downloads "just work" (we don't require any special handling). So, e.g. this works now (which is also used by uBlock to save backups): ```html <a href="data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==" download="backup.txt">Backup</a> ``` https://github.com/gorhill/uBlock/blob/08d370d32e648c2823e1bc31fcd9f7e1f96d155a/platform/chromium/vapi-common.js#L172 GV didn't want to add API for it so I took a stab at adding this to our fetch libs: #6314 (comment) @pocmo can you take a look since we looked at download stuff today :). I've time-boxed this and limited to base64 encoded URIs. The device and unit tests pass and the download works / can be tested here: https://jsfiddle.net/nue9rg0L/2/ Co-authored-by: Christian Sadilek <[email protected]>
6561: Issue #6314: Support fetching non base64 encoded data URIs r=Amejia481 a=csadilek Simple change to support data URI that are not base64 encoded. With this backup/restore is now finally working in uBlock. 6562: Merge day! r=jonalmeida a=pocmo Happy merge day everyone. 🍰 Co-authored-by: Christian Sadilek <[email protected]> Co-authored-by: Sebastian Kaspari <[email protected]>
We currently can't consume downloads from data urls e.g.
This is also the cause of the uBlock "Back up to file" functionality not working:
https://github.com/gorhill/uBlock/blob/08d370d32e648c2823e1bc31fcd9f7e1f96d155a/platform/chromium/vapi-common.js#L172
This is similar to: #1159
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: