Replies: 1 comment 3 replies
-
You might want to check which Firefox version you are using. Up to v107, the Mozilla team has been wanting to use a different security model to implement the Web MIDI API. They finally changed their mind and went with the same model as in Chrome starting with v108 (except for so-called "dangerous capabilities"). Background info on Karim Ratib's blog and on the Mozilla team bug tracker. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goal: I want to be able to tell WebMidi.enable() to stop waiting and give up.
Why? Automated tests (more e2e-ish that uses real dependencies, not mockups such as for real unit tests).
Specifically:
(note: This was not previously a problem because Navigator.requestMIDIAccess was not implemented and noticing the value was 'undefined' meant "don't bother with anything MIDI")
Note: ChromeHeadless "works" - it throws a DOMException, which means at least you're not stuck waiting for the enable() promise to succeed or reject.
Right now I have one of the most hacky workarounds imaginable: I'm doing a setTimeout just before Jasmine is scheduled to timeout, and if we're not through with the setup, I short-circuit the wait by executing the done() function. Yeah, code smell and many other violations!! But I can get through the automation - leaving a dangling Promise in it's wake.
Any thoughts? If there are other better approaches, ignore this one - please!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions