dx7-synth-js icon indicating copy to clipboard operation
dx7-synth-js copied to clipboard

Enable Web MIDI for Firefox 99+

Open infojunkie opened this issue 3 years ago • 1 comments

FF 99 supports Web MIDI as per https://bugzilla.mozilla.org/show_bug.cgi?id=836897. However, there is a little song and dance needed to prompt the user for the Web MIDI permission, as per https://extensionworkshop.com/documentation/publish/site-permission-add-on/.

I've implemented this in my own app at https://github.com/infojunkie/ireal-musicxml/commit/961654554c460bb645cf7a105981f30563f7038e. In a nutshell, here are the steps:

  • Obtain a FF add-on (xpi file) called "site permission generator" that you host on your site, and that each user will download.
  • To show a message on your app that the user needs to download this add-on, you detect an error during navigator.requestMIDIAccess() and you detect that FF is the user agent.
  • The user downloads and installs the add-on, which then shows a second prompt to enable Web MIDI.
  • The user needs to refresh the page. This time, the call to navigator.requestMIDIAccess() will succeed and Web MIDI will be enabled.

You can refer to my commit above for a template of this process. Hope this helps!

infojunkie avatar Apr 11 '22 18:04 infojunkie

Hey, thanks for the heads up and sharing the detailed instructions. I'll take a look when I have a chance to work on dx7-synth-js again.

mmontag avatar Apr 11 '22 21:04 mmontag

This is no longer needed - newer versions of FF show a regular permission prompt to access Web MIDI API.

infojunkie avatar Nov 04 '22 16:11 infojunkie

Ok - thanks for closing!

mmontag avatar Nov 04 '22 19:11 mmontag