jimmywarting / StreamSaver.js

StreamSaver writes stream to the filesystem directly asynchronous
https://jimmywarting.github.io/StreamSaver.js/example.html
MIT License
3.97k stars 413 forks source link

Self-hosted MITM throws errors if metamask is installed #234

Closed JamesCorrigan closed 3 years ago

JamesCorrigan commented 3 years ago

I am having a very strange error. I have mitm.html self-hosted, and downloads are working as expected, but I get the console error: "[StreamSaver] You didn't send a messageChannel". When I examined the event object, I saw the name of a firefox extension I have installed (metamask). When I uninstall metamask, this error disappears. What should I do about this?

jimmywarting commented 3 years ago

I'm guessing you can ignore this error message.

it only looks like if metamask tries to send a postMessage to all kind of iframes, where it have no business. technically mitm do not have to throw error message. the hole postMessage event could be ignored if it knows that it ain't crafted by streamsaver.js

But mitm.html only serves one purpose (which is to forward messages to service workers) so why not just validate the message 🤷‍♂️