From 0e9aeb28b203ae950cb66618c5ef68250ee963a3 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 16 Oct 2026 00:05:33 -0700 Subject: [PATCH] Hook requestMIDIAccess() into Permissions specification --- index.html | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index 80d236b..70f9769 100644 --- a/index.html +++ b/index.html @@ -274,11 +274,10 @@

Requesting MIDI access SHOULD prompt the user for access to MIDI - devices, particularly if [=System Exclusive=] access is - requested. In some scenarios, this permission may have already + devices. In some scenarios, this permission may have already been implicitly or explicitly granted, in which case this prompt - may not appear. If the user gives express permission or the call - is otherwise approved, the vended Promise is resolved. The + may not appear. If the user gives [=express permission=] or the + call is otherwise approved, the vended Promise is resolved. The underlying system may choose to allow the user to select specific [=MIDI interfaces=] to expose to this API (i.e. pick and choose interfaces on an individual basis), although this is not @@ -295,8 +294,8 @@

allowed even if not all vended Promises have settled.

- When the {{requestMIDIAccess()}} method is called, the user agent - MUST run the following steps: + When the {{requestMIDIAccess()}} method is called with + options, the user agent MUST run the following steps:

  1. @@ -326,31 +325,29 @@

  2. - Optionally, e.g. based on a previously-established user - preference, for security reasons, or due to platform + Optionally, for security reasons or due to platform limitations, jump to the step labeled failure below.

  3. - Optionally, e.g. based on a previously-established user - preference, jump to the step labeled success below. + Let descriptor be a newly created + {{MidiPermissionDescriptor}} with + {{PermissionDescriptor/name}} initialized to + "midi" and {{MidiPermissionDescriptor/sysex}} + initialized to options's {{MIDIOptions/sysex}} + member if present and false otherwise.

  4. - Prompt the user in a user-agent-specific manner for permission - to provide the entry script's origin with a {{MIDIAccess}} - object representing control over user's [=MIDI devices=]. This - prompt may be contingent upon whether [=System Exclusive=] - support was requested, and may allow the user to enable or - disable that access. + Let permissionState be the result of + [=request permission to use|requesting permission to use=] + descriptor.

    - If permission is denied, jump to the step labeled - failure below. If the user never responds, this - algorithm will never progress beyond this step. If permission - is granted, continue the following steps. + If permissionState is {{PermissionState/"denied"}}, + jump to the step labeled failure below.