Skip to content

Commit

Permalink
Merge pull request #143 from romandev/secure
Browse files Browse the repository at this point in the history
Use `[SecureContext]` instead of manually throwing an exception
  • Loading branch information
Alexander Shalamov committed Apr 4, 2018
2 parents 1139be1 + 80a0df5 commit e5bccd7
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,7 @@ <h2>The <dfn>NFCRecordType</dfn> enum</h2>
<pre class="idl">
typedef (DOMString or ArrayBuffer or NFCMessage) NFCPushMessage;

[SecureContext]
interface NFC {
Promise&lt;void&gt; push(NFCPushMessage message, optional NFCPushOptions options);
Promise&lt;void&gt; cancelPush(optional NFCPushTarget target="any");
Expand Down Expand Up @@ -1769,14 +1770,6 @@ <h2>The <dfn>NFCWatchMode</dfn> enum</h2>
If any exception occurs while running these steps, reject
<var>promise</var> with that exception and abort these steps.
</li>
<li>
If the <a>incumbent settings object</a> is not a
<a>secure context</a>, reject <var>promise</var> with
<code>"<a>SecurityError</a>"</code> and abort these steps.
<div class="note">
Browsers may ignore this rule for development purposes only.
</div>
</li>
<li>
An implementation MAY reject <var>promise</var> with <code>
"<a>NotSupportedError</a>"</code> and abort these steps.
Expand Down Expand Up @@ -2440,14 +2433,6 @@ <h2>The <dfn>NFCWatchMode</dfn> enum</h2>
Return a new <a><code>Promise</code></a> <var>promise</var> and
then continue running this algorithm <a>in parallel</a>.
</li>
<li>
If the <a>incumbent settings object</a> is not a
<a>secure context</a>, reject <var>promise</var> with
<code>"<a>SecurityError</a>"</code> and abort these steps.
<div class="note">
Browsers may ignore this rule for development purposes only.
</div>
</li>
<li>
If there is an instance of the <code><a>NFC.push</a>()</code>
algorithm running with its <var>options.</var>target equal to
Expand Down Expand Up @@ -2660,14 +2645,6 @@ <h2>The <dfn>NFCWatchMode</dfn> enum</h2>
If any exception occurs while running these steps, reject
<var>promise</var> with that exception and abort these steps.
</li>
<li>
If the <a>incumbent settings object</a> is not a
<a>secure context</a>, reject <var>promise</var> with
<code>"<a>SecurityError</a>"</code> and abort these steps.
<div class="note">
Browsers may ignore this rule for development purposes only.
</div>
</li>
<li>
If there is no support for the functionality of receiving data from
an <a>NFC peer</a> or <a>NFC tag</a> in proximity range, reject
Expand Down Expand Up @@ -2758,14 +2735,6 @@ <h2>The <dfn>NFCWatchMode</dfn> enum</h2>
invoked, the UA MUST return a <a><code>Promise</code></a>
<var>promise</var> and run the following steps <a>in parallel</a>.
<ol id="steps-cancelWatch">
<li>
If the <a>incumbent settings object</a> is not a
<a>secure context</a>, reject <var>promise</var> with
<code>"<a>SecurityError</a>"</code> and abort these steps.
<div class="note">
Browsers may ignore this rule for development purposes only.
</div>
</li>
<li>
If the parameter <var>id</var> is <code>undefined</code>, then
remove all watches and filters set by successive calls of the
Expand Down

0 comments on commit e5bccd7

Please sign in to comment.