Firefox Tomorrow

web api constructor

MIDIConnectionEvent: MIDIConnectionEvent() constructor

View on MDN ↗

Secure context

The MIDIConnectionEvent() constructor creates a new MIDIConnectionEvent object. Typically this constructor is not used as events are created when a new port becomes available, and the object is passed to the statechange event.

Syntax

new MIDIConnectionEvent(type)
new MIDIConnectionEvent(type, midiConnectionEventInit)

Parameters

  • type
    • : A string with one of "connect" or "disconnect".
  • midiConnectionEventInit Optional
    • : A dictionary including the following fields:
      • port
        • : The MIDIPort instance representing the port that has connected or disconnected.
      • bubbles Optional
        • : A boolean value indicating whether the event bubbles. The default is false.
      • cancelable Optional
        • : A boolean value indicating whether the event can be cancelled. The default is false.
      • composed Optional
        • : A boolean value indicating whether the event will trigger listeners outside of a shadow root (see composed for more details). The default is false.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.