Skip to content

Conversation

@Tyschenko
Copy link

For the first time this issue was raised in 2021 MetaMask/metamask-mobile#2195

On both platforms downloading of URLs with blob: prefix (e.g. blob:https://google.com/6c9102b5) or with data: prefix (e.g. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAE) is unsupported.

To test I've used two websites:

  1. https://mdigi.tools/solid-color-image-generator/ Generates data: URL
  2. https://eligrey.com/demos/FileSaver.js/ Generates blob: URL

When user clicks such link, nothing happens. Below you can find two videos, one for blob: URL and one for data: URL.
https://github.com/user-attachments/assets/47f140f9-9f6d-43e0-a982-c4654ec4478f
https://github.com/user-attachments/assets/81f4ea02-1b11-4106-8346-99a5857ed6dd

In this Pull request I updated iOS WebView integration to handle both URLs. Below you can find videos to prove it. Android support is coming in the next PR tomorrow.

https://github.com/user-attachments/assets/caf9eb8d-b7be-47b9-889d-7ae6c21c08cb
https://github.com/user-attachments/assets/6591cee9-aa35-4ad9-8543-b2a6eada014a

@Tyschenko
Copy link
Author

I don't have a good idea how to test this integration 🤔. Please let me know if you have any ideas

@Tyschenko Tyschenko marked this pull request as ready for review May 21, 2025 13:48
@Tyschenko Tyschenko changed the title For iOS add support for downloading files with blob or base64 URLs feat: For iOS add support for downloading files with blob or base64 URLs May 22, 2025
smilingkylan added a commit that referenced this pull request Jun 17, 2025
…or_Android

feat: For Android add support for downloading files with blob or base64 URLs #50
@smilingkylan
Copy link

LGTM

@smilingkylan smilingkylan merged commit ddd9e0f into main Jun 17, 2025
10 checks passed
@smilingkylan smilingkylan deleted the feature/support_blob_downloads_for_iOS branch June 17, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sentry] Metamask mobile crashes when try to download file

3 participants