Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to download blob file #2951

Closed
MuhammadRafeh opened this issue May 6, 2023 · 8 comments · May be fixed by #3022
Closed

Unable to download blob file #2951

MuhammadRafeh opened this issue May 6, 2023 · 8 comments · May be fixed by #3022

Comments

@MuhammadRafeh
Copy link

Bug description:
I am unable to download blob urls using this module.

To Reproduce:
in order to reproduce we can put any blob url in the source url webview component

Expected behavior:
It must download the blob url and call some function in order to know what has been downloaded

Screenshots/Videos:

Environment:

  • OS: Android, iOS
  • OS version: almost latest
  • react-native version: 0.71.7
  • react-native-webview version: 12.0.2
@dineshnadimpalli
Copy link

dineshnadimpalli commented May 16, 2023

+1

can be reproduced by accessing this codepen link on webview

@jordoh
Copy link

jordoh commented May 19, 2023

According to this StackOverflow discussion there are some additional delegates necessary for handling downloads.

I can verify that decidePolicyForNavigationAction is called in RNCWebView when the blob URL link is clicked (either via user interaction or javascript link.click()), with a URL that looks like: blob:file:///c45de352-c734-46ca-8473-ce4551a89e59. With the default WKNavigationActionPolicyAllow decision there, decidePolicyForNavigationResponse is called with the same (blob) URL, which is not very useful there (can't be accessed outside the WKWebView).

@dingcxx
Copy link

dingcxx commented Jun 16, 2023

According to this StackOverflow discussion there are some additional delegates necessary for handling downloads.

I can verify that decidePolicyForNavigationAction is called in RNCWebView when the blob URL link is clicked (either via user interaction or javascript link.click()), with a URL that looks like: blob:file:///c45de352-c734-46ca-8473-ce4551a89e59. With the default WKNavigationActionPolicyAllow decision there, decidePolicyForNavigationResponse is called with the same (blob) URL, which is not very useful there (can't be accessed outside the WKWebView).

Android working well?

@jordoh
Copy link

jordoh commented Jun 19, 2023

Android working well?

Nope - on Android the blob URL doesn't get opened/saved when using link.click() (or equivalent via dispatchEvent) nor when setting window.location = blobURL. There's likely an equivalent download handler for Android's webview.

@dingcxx
Copy link

dingcxx commented Jun 21, 2023

Android working well?

Nope - on Android the blob URL doesn't get opened/saved when using link.click() (or equivalent via dispatchEvent) nor when setting window.location = blobURL. There's likely an equivalent download handler for Android's webview.

I choose web bridge

@github-actions
Copy link

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

@fukemy
Copy link

fukemy commented Jan 31, 2024

hi any patches to solve this?

@remberluyckx
Copy link

Anyone have an idea how to open a blob url inside a webview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants