Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Markdown] [Web/API] Raft of randomness #8508

Merged
merged 13 commits into from
Sep 1, 2021
10 changes: 5 additions & 5 deletions files/en-us/web/api/blobbuilder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h3 id="append()">append()</h3>
);
</pre>

<h6 id="Parameters">Parameters</h6>
<h4 id="Parameters">Parameters</h4>

<dl>
<dt><code>data</code></dt>
Expand All @@ -103,15 +103,15 @@ <h3 id="getBlob()">getBlob()</h3>
);
</pre>

<h6 id="Parameters_2">Parameters</h6>
<h4 id="Parameters_2">Parameters</h4>

<dl>
<dt><code>contentType</code> {{optional_inline}}</dt>
<dd>The MIME type of the data to be returned in the {{domxref("Blob")}}. This will be
the value of the <code>Blob</code> object's type property.</dd>
</dl>

<h6 id="Return_value">Return value</h6>
<h4 id="Return_value">Return value</h4>

<p>A {{domxref("Blob")}} object containing all of the data passed to any calls to
{{manch("append")}} made since the <code>BlobBuilder</code> was created. This also
Expand All @@ -128,7 +128,7 @@ <h3 id="getFile()_non-standard_inline">getFile() {{non-standard_inline}}</h3>
);
</pre>

<h6 id="Parameters_3">Parameters</h6>
<h4 id="Parameters_3">Parameters</h4>

<dl>
<dt><code>name</code></dt>
Expand All @@ -138,7 +138,7 @@ <h6 id="Parameters_3">Parameters</h6>
the value of the <code>File</code> object's type property.</dd>
</dl>

<h6 id="Return_value_2">Return value</h6>
<h4 id="Return_value_2">Return value</h4>

<p>A {{domxref("File")}} object.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 id="Syntax">Syntax</h2>
void <em>ctx</em>.drawImage(<em>image</em>, <em>sx</em>, <em>sy</em>, <em>sWidth</em>, <em>sHeight</em>, <em>dx</em>, <em>dy</em>, <em>dWidth</em>, <em>dHeight</em>);
</pre>

<p><img alt="drawImage" src="canvas_drawimage.jpg"</p>
<p><img alt="drawImage" src="canvas_drawimage.jpg"></p>

<h3 id="Parameters">Parameters</h3>

Expand Down
14 changes: 7 additions & 7 deletions files/en-us/web/api/constraint_validation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ <h3 id="Extensions_to_other_interfaces">Extensions to other interfaces</h3>
<p>The constraint validation API extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a <code>form</code> attribute that indicates their form owner):</p>

<ul>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLButtonElement">HTMLButtonElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLFieldSetElement">HTMLFieldsetElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLInputElement">HTMLInputElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLObjectElement">HTMLObjectElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLOutputElement">HTMLOutputElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLSelectElement">HTMLSelectElement</a></strong></code></li>
<li><code><strong><a href="/en-US/docs/Web/API/HTMLTextAreaElement">HTMLTextAreaElement</a></strong></code></li>
<li>{{domxref("HTMLButtonElement")}}</li>
<li>{{domxref("HTMLFieldsetElement")}}</li>
<li>{{domxref("HTMLInputElement")}}</li>
<li>{{domxref("HTMLObjectElement")}}</li>
<li>{{domxref("HTMLOutputElement")}}</li>
<li>{{domxref("HTMLSelectElement")}}</li>
<li>{{domxref("HTMLTextAreaElement")}}</li>
</ul>

<h4 id="Properties">Properties</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 id="Syntax">Syntax</h2>
<pre
class="brush: js">DOMMatrix.translate(<em>translateX</em>, <em>translateY</em>[, <em>translateZ]</em>)</pre>

<h3">Parameters</h3>
<h3>Parameters</h3>

<dl>
<dt>translateX</dt>
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/element/computedstylemap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ <h2 id="Examples">Examples</h2>
stylesList.appendChild(cssValue);
}</pre>

<p>In <a #browser_compatibility">browsers that support <code>computedStyleMap()</code></a>,
you'll see a list of all the CSS properties and values.
<p>In <a href= "#Browser_compatibility">browsers that support <code>computedStyleMap()</code></a>,
you'll see a list of all the CSS properties and values.
In other browsers you'll just see a link.</p>

<p>{{EmbedLiveSample("Examples", 300, 300)}}</p>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/element/id/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<p>The <strong><code>id</code></strong> property of the {{domxref("Element")}} interface
represents the element's identifier, reflecting the
<code><strong><a href="/en-US/docs/Web/HTML/Global_attributes/id">id</a></strong></code>
<a href="/en-US/docs/Web/HTML/Global_attributes/id"><code><strong>id</strong></code></a>
global attribute.</p>

<p>If the <code>id</code> value is not the empty string, it must be unique in a document.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/filelist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ <h3 id="item()">item()</h3>
);
</pre>

<h6 id="Parameters">Parameters</h6>
<h4 id="Parameters">Parameters</h4>

<dl>
<dt><code>index</code></dt>
<dd>The zero-based index of the file to retrieve from the list.</dd>
</dl>

<h6 id="Return_value">Return value</h6>
<h4 id="Return_value">Return value</h4>

<p>The <a href="/en-US/docs/Web/API/File"><code>File</code></a> representing the requested file.</p>

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/htmlelement/tabindex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ <h2 id="See_also">See also</h2>
href="/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets">Accessibility
of keyboard-navigable JavaScript widgets</a></li>
<li>The HTML
<code><a href="/en-US/docs/Web/HTML/Global_attributes/tabindex"><strong>tabindex</strong></a></code>
<a href="/en-US/docs/Web/HTML/Global_attributes/tabindex"><code>tabindex</code></a>
global attribute.</li>
</ul>
6 changes: 0 additions & 6 deletions files/en-us/web/api/htmlimageelement/usemap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ <h2 id="Example">Example</h2>

<div>{{EmbedInteractiveExample("pages/tabbed/area.html", "tabbed-taller")}}</div>

<p class="hidden">The source for this interactive example is stored in a GitHub
repository. If you'd like to contribute to the interactive examples project, please
clone <a
href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples
</a> and send us a pull request.</p>

<h2 id="Specifications">Specifications</h2>

{{Specifications}}
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbrequest/error/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h2 id="Example">Example</h2>
<code>objectStoreTitleRequest.result</code>, updates one property of the record, and then puts the
updated record back into the object store. Also included at the bottom is an
<code>onerror</code> function that reports what the error was if the request fails.
For a full working example, see our <ahref="https://github.com/mdn/to-do-notifications/">To-do
For a full working example, see our <a href="https://github.com/mdn/to-do-notifications/">To-do
Notifications</a> app (<a href="https://mdn.github.io/to-do-notifications/">view example live</a>.)</p>

<pre class="brush: js">var title = "Walk dog";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ <h3 id="navigator.onLine"><code>navigator.onLine</code></h3>

<p><code><a href="/en-US/docs/DOM/window.navigator.onLine">navigator.onLine</a></code> is a property that maintains a <code>true</code>/<code>false</code> value (<code>true</code> for online, <code>false</code> for offline).</p>

<p>This property is updated whenever the user switches into "Offline Mode" (File → Work Offline in Firefox). Additionally, this property should update whenever a browser is no longer capable of connecting to the network. According to the specification:</p>
<p>This property is updated whenever the user switches into "Offline Mode" (File → Work Offline in Firefox). Additionally, this property should update whenever a browser is no longer capable of connecting to the network. According to the <a href="https://www.whatwg.org/specs/web-apps/current-work/#offline">specification</a>:</p>

<blockquote cite="https://www.whatwg.org/specs/web-apps/current-work/#offline">The <code>navigator.onLine</code> attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...</blockquote>
<blockquote>The <code>navigator.onLine</code> attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...</blockquote>

<p>Firefox 2 updates this property when switching to/from the browser's Offline mode.  <a href="/en-US/Firefox/Releases/41#Miscellaneous">Firefox 41</a> updates this property also when the OS reports a change in network connectivity on Windows, Linux, and OS X.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,6 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat}}</p>

<ul>
<li>[1] Speech recognition interfaces are currently prefixed on Chrome, so you'll need
to prefix interface names appropriately, e.g. <code>webkitSpeechRecognition</code>;
You'll also need to serve your code through a web server for recognition to work.</li>
<li>[2] Can be enabled via the <code>media.webspeech.recognition.enable</code> flag in
<a>about:config</a>, although note that currently speech recognition won't work on
Desktop Firefox — it will be properly exposed soon, once the required internal
permissions are sorted out.</li>
</ul>

<h3 id="Firefox_OS_permissions">Firefox OS permissions</h3>

<p>To use speech recognition in an app, you need to specify the following permissions in
your <a href="/en-US/docs/Web/Apps/Build/Manifest">manifest</a>:</p>

<pre class="brush: json">"permissions": {
"audio-capture" : {
"description" : "Audio capture"
},
"speech-recognition" : {
"description" : "Speech recognition"
}
}</pre>

<p>You also need a privileged app, so you need to include this as well:</p>

<pre class="brush: json"> "type": "privileged"</pre>

<h2 id="See_also">See also</h2>

<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,6 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat}}</p>

<ul>
<li>[1] Speech recognition interfaces are currently prefixed on Chrome, so you'll need
to prefix interface names appropriately, e.g. <code>webkitSpeechRecognition</code>;
You'll also need to serve your code through a web server for recognition to work.</li>
<li>[2] Can be enabled via the <code>media.webspeech.recognition.enable</code> flag in
<a>about:config</a>, although note that currently speech recognition won't work on
Desktop Firefox — it will be properly exposed soon, once the required internal
permissions are sorted out.</li>
</ul>

<h3 id="Firefox_OS_permissions">Firefox OS permissions</h3>

<p>To use speech recognition in an app, you need to specify the following permissions in
your <a href="/en-US/docs/Web/Apps/Build/Manifest">manifest</a>:</p>

<pre class="brush: json">"permissions": {
"audio-capture" : {
"description" : "Audio capture"
},
"speech-recognition" : {
"description" : "Speech recognition"
}
}</pre>

<p>You also need a privileged app, so you need to include this as well:</p>

<pre class="brush: json"> "type": "privileged"</pre>

<h2 id="See_also">See also</h2>

<ul>
Expand Down
14 changes: 9 additions & 5 deletions files/en-us/web/api/web_authentication_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ <h3 id="Registration">Registration</h3>

<p><em>Figure 1 - a diagram showing the sequence of actions for a web authentication registration and the essential data associated with each action.</em></p>

<p>The registration steps are:</p>
<p>First (labeled step 0 in the diagram), the application makes the initial registration request. The protocol and format of this request are outside the scope of the Web Authentication API.</p>

<ol start="0">
<li><strong>Application Requests Registration</strong> - The application makes the initial registration request. The protocol and format of this request is outside of the scope of the Web Authentication API.</li>
<p>After this, the registration steps are:</p>

<ol>
<li><strong>Server Sends Challenge, User Info, and Relying Party Info</strong> - The server sends a challenge, user information, and relying party information to the JavaScript program. The protocol for communicating with the server is not specified and is outside of the scope of the Web Authentication API. Typically, server communications would be <a href="/en-US/docs/Glossary/REST">REST</a> over https (probably using <a href="/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequest</a> or <a href="/en-US/docs/Web/API/Fetch_API">Fetch</a>), but they could also be <a href="/en-US/docs/Glossary/SOAP">SOAP</a>, <a href="https://datatracker.ietf.org/doc/html/rfc2549">RFC 2549</a> or nearly any other protocol provided that the protocol is secure. The parameters received from the server will be passed to the <a href="/en-US/docs/Web/API/CredentialsContainer/create">create()</a> call, typically with little or no modification and returns a <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a> that will resolve to a {{domxref("PublicKeyCredential")}} containing an {{domxref("AuthenticatorAttestationResponse")}}. <strong>Note that it is absolutely critical that the challenge be a buffer of random information (at least 16 bytes) and it MUST be generated on the server in order to ensure the security of the registration process.</strong></li>
<li><strong>Browser Calls authenticatorMakeCredential() on Authenticator</strong> - Internally, the browser will validate the parameters and fill in any defaults, which become the {{domxref("AuthenticatorResponse.clientDataJSON")}}. One of the most important parameters is the origin, which is recorded as part of the clientData so that the origin can be verified by the server later. The parameters to the create() call are passed to the authenticator, along with a SHA-256 hash of the clientDataJSON (only a hash is sent because the link to the authenticator may be a low-bandwidth NFC or Bluetooth link and the authenticator is just going to sign over the hash to ensure that it isn't tampered with).</li>
<li><strong>Authenticator Creates New Key Pair and Attestation</strong> - Before doing anything, the authenticator will typically ask for some form of user verification. This could be entering a PIN, using a fingerprint, doing an iris scan, etc. to prove that the user is present and consenting to the registration. After the user verification, the authenticator will create a new asymmetric key pair and safely store the private key for future reference. The public key will become part of the attestation, which the authenticator will sign over with a private key that was burned into the authenticator during its manufacturing process and that has a certificate chain that can be validated back to a root of trust.</li>
Expand All @@ -78,8 +79,11 @@ <h3 id="Authentication">Authentication</h3>

<p><em>Figure 2 - similar to Figure 1, a diagram showing the sequence of actions for a web authentication and the essential data associated with each action.</em></p>

<ol start="0">
<li><strong>Application Requests Authentication</strong> - The application makes the initial authentication request. The protocol and format of this request is outside of the scope of the Web Authentication API.</li>
<p>First (labeled step 0 in the diagram), the application makes the initial registration request. The protocol and format of this request are outside the scope of the Web Authentication API.</p>

<p>After this, the registration steps are:</p>

<ol>
<li><strong>Server Sends Challenge</strong> - The server sends a challenge to the JavaScript program. The protocol for communicating with the server is not specified and is outside of the scope of the Web Authentication API. Typically, server communications would be <a href="/en-US/docs/Glossary/REST">REST</a> over https (probably using <a href="/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequest</a> or <a href="/en-US/docs/Web/API/Fetch_API">Fetch</a>), but they could also be <a href="/en-US/docs/Glossary/SOAP">SOAP</a>, <a href="https://datatracker.ietf.org/doc/html/rfc2549">RFC 2549</a> or nearly any other protocol provided that the protocol is secure. The parameters received from the server will be passed to the <a href="/en-US/docs/Web/API/CredentialsContainer/get">get()</a> call, typically with little or no modification. <strong>Note that it is absolutely critical that the challenge be a buffer of random information (at least 16 bytes) and it MUST be generated on the server in order to ensure the security of the authentication process.</strong></li>
<li><strong>Browser Calls authenticatorGetCredential() on Authenticator</strong> - Internally, the browser will validate the parameters and fill in any defaults, which become the {{domxref("AuthenticatorResponse.clientDataJSON")}}. One of the most important parameters is the origin, which recorded as part of the clientData so that the origin can be verified by the server later. The parameters to the get() call are passed to the authenticator, along with a SHA-256 hash of the clientDataJSON (only a hash is sent because the link to the authenticator may be a low-bandwidth NFC or Bluetooth link and the authenticator is just going to sign over the hash to ensure that it isn't tampered with).</li>
<li><strong>Authenticator Creates an Assertion</strong> - The authenticator finds a credential for this service that matches the Relying Party ID and prompts a user to consent to the authentication. Assuming both of those steps are successful, the authenticator will create a new assertion by signing over the clientDataHash and authenticatorData with the private key generated for this account during the registration call.</li>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/web_storage_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h2 id="Web_Storage_interfaces">Web Storage interfaces</h2>
<dt>{{domxref("Window")}}</dt>
<dd>The Web Storage API extends the {{domxref("Window")}} object with two new properties — {{domxref("Window.sessionStorage")}} and {{domxref("Window.localStorage")}} — which provide access to the current domain's session and local {{domxref("Storage")}} objects respectively, and a {{domxref("WindowEventHandlers.onstorage")}} event handler that fires when a storage area changes (e.g. a new item is stored.)</dd>
<dt>{{domxref("StorageEvent")}}</dt>
<dd>The <code title="event-storage">storage</code> event is fired on a document's <code>Window</code> object when a storage area changes.</dd>
<dd>The <code>storage</code> event is fired on a document's <code>Window</code> object when a storage area changes.</dd>
</dl>

<h2 id="Examples">Examples</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3>Table of Contents</h3>
</li>
<li>
<a href="Build_a_phone_with_peerjs/Connect_peers">Connect Peers</a>
<ol type="i">
<ol>
<li>
<a href="Build_a_phone_with_peerjs/Connect_peers/Get_microphone_permission">Get Microphone Permission</a>
</li>
Expand Down
Loading