Feature #565
openSee if it is possible to download a file contained in a blob
0%
Description
la page :
https://media.interieur.gouv.fr/deplacement-covid-19/
génère un fichier PDF que l'on doit pouvoir enregistrer dans la mémoire du téléphone. Avec privacy browser on ne peut pas l'enregistrer car cela signale "invalid url" dans la boîte de dialogue de l'enregistrement du fichier
Updated by Soren Stoutner over 4 years ago
I do not speak the language this is written in (perhaps French?). Can you please repost it in English?
Updated by Pure Incompetence over 4 years ago
Translation from deepl.com/translate :
The Webpage
https://media.interieur.gouv.fr/deplacement-covid-19/
generates a PDF file that you should be able to save in the phone memory. With privacy browser it cannot be saved because it signals "invalid url" in the file saving dialog box.
Updated by Soren Stoutner over 4 years ago
- Subject changed from impossibilité d'enregistrer un fichier PDF généré par une page web to Files contained in blob's instead of normal URLs cannot be downloaded.
- Status changed from New to Closed
The problem is caused by the poor website design, which attempts to contain the PDF in a blob, as can be seen in the generated URL: blob:https://media.interieur.gouv.fr/.
Android's WebView doesn't provide any way to turn a blob into a file (this is really poor web design). As such, any browser based on WebView will not be able to download this file. For example, Lightning attempts to download the file, but nothing happens. FOSS Browser crashes if the download is attempted.
Updated by Soren Stoutner over 4 years ago
- Subject changed from Files contained in blob's instead of normal URLs cannot be downloaded. to Files contained in blobs instead of normal URLs cannot be downloaded.
Updated by Soren Stoutner over 4 years ago
- Tracker changed from Bug to Feature
- Subject changed from Files contained in blobs instead of normal URLs cannot be downloaded. to See if it is possible to download a file contained in a blob.
- Status changed from Closed to New
It should be possible to extract the URL, but I don't know if it will work in the case of this specific website unless it contains more than just the domain name.
Updated by Soren Stoutner almost 4 years ago
At a minimum, this will become possible with the release of Privacy WebView in the 4.x series. But it might be possible to extract this information from DOM storage somehow.
Updated by Anonymous over 3 years ago
I have faced the same error in "Snapdrop" (https://github.com/RobinLinus/snapdrop).
I made some tests, too.
A lot of browsers in the F-Droid store seem to have similar problems with this type of download; in short, they can't download the files.
But... It works just fine with the Android versions of Firefox & Chrome.
Updated by Soren Stoutner over 3 years ago
Firefox and Chrome (and browsers based on them) can download blobs because they can walk the DOM tree and extract the blob. But Android's System WebView does not expose the DOM in the same way, so browsers that are based on WebView, like Privacy Browser and a number of other browsers on F-Droid, cannot download blobs.
Updated by Soren Stoutner about 1 year ago
- Subject changed from See if it is possible to download a file contained in a blob. to See if it is possible to download a file contained in a blob
Updated by Soren Stoutner 10 months ago
https://fonts.google.com/icons is another good test site.
Updated by ask low 10 months ago
The google icons website you've provided, are obviously blobs. But when I tested my proton drive downloads, they're considered blobs too. But strangely they aren't.
For instance, there's a closed source chinese browser called Via was able to download proton drive files. When analysed the file url it shows as data instead of blob. Here's the url form data:application/zip;base64,<some-long-data-string>==
Updated by Soren Stoutner 10 months ago
Sounds like Proton Drive sometimes presents as data URLs and other times as blob URLs. Servers can choose to do things like that if they want to. It might depend on how the browser presents itself, like the User Agent or some other behavior.
Updated by Soren Stoutner 10 months ago
Thinking about it a little bit more, when you download something from a blob (a storage location in the DOM accessed by JavaScript) it contains a data URL with the actual item. So, to be able to handle downloading of blobs you first must be able to walk the DOM to find the blob, then you must convert the data URL it contains into the file you want to save.
Privacy Browser Android already knows how to convert data URLs into files and save them. But because Android's WebView does not provide a built-in downloader, and because it does not expose the DOM in a way that is easy to walk to find the blob, that is the step where downloading blobs breaks down for browsers based on WebView.
There might be some way to walk the tree and extract the data URL from the blob using JavaScript injection. When I get around to looking deeply at this feature I am going to take the time to explore that. Otherwise, it will probably have to wait for the 4.x series.
Updated by Soren Stoutner 10 months ago
Or, you know, you could always submit a feature request to Proton Drive to present their file downloads as actual https URLs (best, in my opinion), or as data URLs (second best) instead of wrapping them in a blob.