StreamSaver.js icon indicating copy to clipboard operation
StreamSaver.js copied to clipboard

Ignore messages other than from iframe parent

Open lukaw3d opened this issue 4 years ago • 3 comments

Malformed messages from extensions throw errors (though download still works). This filters out messages, except those coming from iframe parent.

To reproduce errors:

  • Install MetaMask extension
  • Open https://jimmywarting.github.io/StreamSaver.js/examples/fetch.html
  • Click "Start" button
  • See errors in browser console
Uncaught TypeError: [StreamSaver] You didn't send a messageChannel    at onMessage (mitm.html?version=2.0.0:66)
Uncaught TypeError: [StreamSaver] You didn't send a messageChannel    at onMessage (mitm.html?version=2.0.0:66)
Uncaught (in promise) TypeError: [StreamSaver] You didn't send a messageChannel    at onMessage (mitm.html?version=2.0.0:66)
Uncaught TypeError: [StreamSaver] You didn't send a messageChannel    at onMessage (mitm.html?version=2.0.0:66)
Uncaught TypeError: [StreamSaver] You didn't send a messageChannel    at onMessage (mitm.html?version=2.0.0:66)

lukaw3d avatar Oct 15 '21 03:10 lukaw3d

@jimmywarting do you have plans to merge? this PR also works for other extensions

AmilKey avatar Feb 13 '24 09:02 AmilKey