djipco / webmidi

Tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).
Apache License 2.0
1.54k stars 115 forks source link

WebMidi.supported returns non boolean #417

Closed SteveALee closed 5 months ago

SteveALee commented 5 months ago
  get supported() {
    return (typeof navigator !== "undefined" && navigator.requestMIDIAccess);
  }

returns navigator.requestMIDIAccess

code should be something like

  get supported() {
    return (typeof navigator !== "undefined" && !!navigator.requestMIDIAccess);
  }
djipco commented 5 months ago

Thanks for reporting. Fixed in 8d42de2 (available in release 3.1.9).