Skip to content

Commit 98c8057

Browse files
authored
Merge pull request #181 from raymeskhoury/gh-pages
Add Feature Policy integration for WebMidi
2 parents 01853e3 + 66762f1 commit 98c8057

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

index.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,19 @@ <h2>Terminology</h2>
142142
<section>
143143
<h2>Obtaining Access to MIDI Devices</h2>
144144

145+
<section>
146+
<h2>Feature Policy Integration</h2>
147+
<p>
148+
<a data-lt="Navigator.requestMIDIAccess">requestMIDIAccess</a> is a <a data-cite="FEATURE-POLICY#policy-controlled-feature">policy-controlled feature</a>, as defined by <a data-cite="FEATURE-POLICY">Feature Policy</a>.
149+
</p>
150+
<p>
151+
The <a data-cite="FEATURE-POLICY#feature-name">feature name</a> for <a data-lt="Navigator.requestMIDIAccess">requestMIDIAccess</a> is <dfn data-lt="midi-fp" data-lt-noDefault><code>midi</code></dfn>.
152+
</p>
153+
<p>
154+
The <a data-cite="FEATURE-POLICY#default-allowlist">default allowlist</a> for <a data-lt="Navigator.requestMIDIAccess">requestMIDIAccess</a> is <code>["self"]</code>.
155+
</p>
156+
</section>
157+
145158
<section data-dfn-for="Navigator">
146159
<h2>Extensions to the <dfn>Navigator</dfn> interface</h2>
147160

@@ -182,6 +195,14 @@ <h2>Extensions to the <dfn>Navigator</dfn> interface</h2>
182195
<ol>
183196
<li><p>Let <var>promise</var> be a new Promise object and <var>resolver</var> be its associated resolver.</p></li>
184197
<li><p>Return <var>promise</var> and run the following steps asynchronously.</p></li>
198+
<li><p>Let <var>document</var> be the calling context's <a data-cite="!DOM#concept-document">Document</a>.</p></li>
199+
<li>
200+
<p>
201+
If <var>document</var> is not <a data-cite="!HTML#allowed-to-use">allowed to use</a> the
202+
<a data-cite="FEATURE-POLICY#policy-controlled-feature">policy-controlled feature</a> named
203+
<a data-lt="midi-fp" data-lt-noDefault>midi</a>, jump to the step labeled <em>failure</em> below.
204+
</p>
205+
</li>
185206

186207
<li><p>
187208
Optionally, e.g. based on a previously-established user
@@ -221,7 +242,7 @@ <h2>Extensions to the <dfn>Navigator</dfn> interface</h2>
221242

222243
<li><p><em><b>failure</b></em>: Let <var>error</var> be a new <a>DOMException</a>.
223244
This exception's .name should be <code>"SecurityError"</code> if the
224-
user or their security settings denied the application from creating a MIDIAccess instance with the requested options, <code>"AbortError"</code> if the page is going to be closed for a user navigation, <code>"InvalidStateError"</code> if the underlying systems raise any errors, or otherwise it should be <code>"NotSupportedError"</code>.</p></li>
245+
user or their security settings denied the application from creating a MIDIAccess instance with the requested options, or if the error is the result of <var>document</var> not being <a data-cite="!HTML#allowed-to-use">allowed to use</a> the feature, <code>"AbortError"</code> if the page is going to be closed for a user navigation, <code>"InvalidStateError"</code> if the underlying systems raise any errors, or otherwise it should be <code>"NotSupportedError"</code>.</p></li>
225246
<li><p>Call <var>resolver</var>'s <code>reject(value)</code> method with <var>error</var> as value argument.</p></li>
226247
</ol>
227248

0 commit comments

Comments
 (0)