Skip to content

fix: Download file requested when connecting to any Dapp #58

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

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

Tyschenko
Copy link

Issue in the tracker: MetaMask/metamask-mobile#16528

Previous JS injection was catching a Blob file creation and triggered downloading immediately. Turned out some Dapps may create Blob files without user actually trying to download these files. To prevent the issue, we try to download Blobs only on clicks on download elements in the website or when Android receives a download callback.

To test Blob file downloading I use two websites:
https://eligrey.com/demos/FileSaver.js/
https://tyschenko.github.io/download_blob_file.html

Screenshot of the problem in Uniswap.org Dapp:
457889042-5c20882c-aec2-44a1-8f98-04c9a1d73bbd

Video of the solution showing downloading of Blob files and opening of Uniswap.org and pancakeswap.finance Dapps:
https://github.com/user-attachments/assets/991b9a3b-a9f6-4c72-b25f-1133832ef1f0

Previous JS injection was catching a Blob file creation and triggered downloading immediately. Turned out some Dapps may create Blob files without user actually trying to download these files. To prevent the issue, we try to download Blobs only on clicks on download elements in the website or when Android receives a download callback
@Tyschenko Tyschenko added the bug Something isn't working label Jun 24, 2025
package.json Outdated
@@ -10,7 +10,7 @@
"Thibault Malbranche <malbranche.thibault@gmail.com>"
],
"license": "MIT",
"version": "14.2.0",
"version": "14.2.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bump the version in a separate release PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Downgraded back to 14.2.0

Copy link

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tyschenko Tyschenko merged commit a1f1697 into main Jun 24, 2025
10 of 12 checks passed
@Tyschenko Tyschenko mentioned this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Download file requested when connecting to any Dapp
2 participants