mozilla-mobile / android-components

⚠️ This project moved to a new repository. It is now developed and maintained at: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.02k stars 473 forks source link

Unable to download urls that contain prefix blob: #1159

Closed Amejia481 closed 4 years ago

Amejia481 commented 6 years ago
 java.lang.IllegalArgumentException: Can only download HTTP/HTTPS URIs: blob:https://
        at android.app.DownloadManager$Request.<init>(DownloadManager.java:445)
        at mozilla.components.feature.downloads.DownloadManager.download(DownloadManager.kt:63)
        at mozilla.components.feature.downloads.DownloadManager.download$default(DownloadManager.kt:52)
        at mozilla.components.feature.downloads.DownloadsFeature$showDialog$1.invoke(DownloadsFeature.kt:105)
        at mozilla.components.feature.downloads.DownloadsFeature$showDialog$1.invoke(DownloadsFeature.kt:37)
        at mozilla.components.feature.downloads.SimpleDownloadDialogFragment$onCreateDialog$$inlined$with$lambda$1.onClick(SimpleDownloadDialogFragment.kt:59)
        at android.support.v7.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6165)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

┆Issue is synchronized with this Jira Task

pocmo commented 6 years ago

Short-term solution: Ignoring those download requests.

Long-term: Saving the data behind the blob URL as Download.

behlsoft commented 6 years ago

hi team, any update regarding this bug.

NotWoods commented 5 years ago

Steps to reproduce:

  1. Open https://squoosh.app/
  2. Select one of the predefined images, such as the large fox photo.
  3. Tap the blue download button.
sv-ohorvath commented 5 years ago

Still reproducing on Nightly 11/13. Thanks!

jonalmeida commented 5 years ago

I was also able to reproduce this from the STR in this comment if ever need more links to try: https://github.com/mozilla-mobile/fenix/issues/2579#issuecomment-535981773

lovasoa commented 4 years ago

Could this issue be revived ? It is preventing the download of COVID19 attestation from the french government website.

Amejia481 commented 4 years ago

Could this issue be revived ? It is preventing the download of COVID19 attestation from the french government website.

@lovasoa do not worry @kglazko is taking a look at it!

madb1lly commented 4 years ago

For comparison, in Fennec F-Droid it doesn't work either, but the reason is different - clicking the button to generate the attestion doesn't even attempt a download.

Cheers πŸ™‚

klint commented 4 years ago

Note that as a comparison, it works on old Firefox for Android beta, but I fear when this beta will be upgraded to Fenix any time soon!! Thanks for taking care of it in these dire times. :)

liuche commented 4 years ago

Downgrading this to a P2 for now so that not everything we send to GV is P1 - we should bump this later if we reprioritize on the Fenix side.

kbrosnan commented 4 years ago

This is one of the more common download issues users encounter. There is a fairly good list of dupes here, on Fenix, and Webcompat.

madb1lly commented 4 years ago

Note that as a comparison, it works on old Firefox for Android beta, but I fear when this beta will be upgraded to Fenix any time soon!! Thanks for taking care of it in these dire times. :)

Hi all, I checked Fennec F-Droid again and it downloads the attestation form fine, I don't know what I was doing wrong before. Cheers πŸ™‚

Songbird0 commented 4 years ago

Still doesn't work. Tested on: https://media.interieur.gouv.fr/deplacement-covid-19/

Version: 5.0.0 (Build #21212136) 39.0.1, f19856fa4 GV: 76.0-20200424000239 AS: 0.58.2

miketaylr commented 4 years ago

Also affecting mega downloads https://www.reddit.com/r/firefox/comments/gi3s23/cant_download_files_from_mega/

TitanNano commented 4 years ago

We can download blobs πŸŽŠπŸŽ‰ (tested with telegram web and squoosh.app)

Amejia481 commented 4 years ago

We can download blobs πŸŽŠπŸŽ‰ (tested with telegram web and squoosh.app)

Awesome :) We still have some issues with Firefox Send and some extensions that use blobs, but most of the sites should work now. We need help to test multiple sites and discover possible edge cases, if you see something that is not working please, let us know :)

madb1lly commented 4 years ago

Hi all, Confirmed working for https://media.interieur.gouv.fr/deplacement-covid-19/ Cheers πŸ˜ƒ

Amejia481 commented 4 years ago

I tested with the latest geckoview version 78.0.20200521093657 and the FireFox send issue is gone πŸŽ‰ . For this be on Fenix we need a new version of ac that includes the above GV version. We can close issue and follow the https://github.com/mozilla-mobile/fenix/issues/3336#issue-454639904 ticket to confirm with QA

1M6host commented 4 years ago

please if anyone is facing this issue.. the following worked for me :-

go to "\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview" in your android studio and then method "webView.setDownloadListener()"

    DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url.replace("blob:","")));

replace this line

rebuild and run the app normally

avinashsahoo commented 2 years ago

please if anyone is facing this issue.. the following worked for me :-

go to "\node_modules\react-native-webview\android\src\main\java\com\reactnativecommunity\webview" in your android studio and then method "webView.setDownloadListener()"

    DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url.replace("blob:","")));

replace this line

rebuild and run the app normally

This will prevent crashing. It'll not download the file.

Please confirm, if the file being downloaded.