Skip to content

Commit fd43e39

Browse files
User permission must be required before checking NFC adapter/setting state (#530)
1 parent 8c7a5fe commit fd43e39

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

index.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,23 +2351,6 @@ <h3><dfn>Writing or pushing content</dfn></h3>
23512351
<li>
23522352
Let |options:NDEFPushOptions| be the second argument.
23532353
</li>
2354-
<li>
2355-
If there is no underlying <a>NFC Adapter</a>, or if a connection
2356-
cannot be established, then reject |p| with a
2357-
{{"NotSupportedError"}} {{DOMException}}
2358-
and return |p|.
2359-
</li>
2360-
<li>
2361-
If the UA is not allowed to access the underlying <a>NFC Adapter</a>
2362-
(e.g. a user preference), then reject |p| with a
2363-
{{"NotReadableError"}} {{DOMException}}
2364-
and return |p|.
2365-
</li>
2366-
<li>
2367-
If pushing data is not supported by the underlying
2368-
<a>NFC Adapter</a>, then reject |p| with a {{"NotSupportedError"}}
2369-
{{DOMException}} and return |p|.
2370-
</li>
23712354
<li>
23722355
Let |signal:AbortSignal| be the |options|’ dictionary member
23732356
of the same name if present, or `null` otherwise.
@@ -2399,6 +2382,28 @@ <h3><dfn>Writing or pushing content</dfn></h3>
23992382
<li>
24002383
Return |p| and run the following steps <a>in parallel</a>:
24012384
<ol>
2385+
<li>
2386+
If the <a>obtain permission</a> steps return `false`, then
2387+
reject |p| with a {{"NotAllowedError"}} {{DOMException}} and
2388+
abort these steps.
2389+
</li>
2390+
<li>
2391+
If there is no underlying <a>NFC Adapter</a>, or if a connection
2392+
cannot be established, then reject |p| with a
2393+
{{"NotSupportedError"}} {{DOMException}}
2394+
and return |p|.
2395+
</li>
2396+
<li>
2397+
If the UA is not allowed to access the underlying <a>NFC Adapter</a>
2398+
(e.g. a user preference), then reject |p| with a
2399+
{{"NotReadableError"}} {{DOMException}}
2400+
and return |p|.
2401+
</li>
2402+
<li>
2403+
If pushing data is not supported by the underlying
2404+
<a>NFC Adapter</a>, then reject |p| with a {{"NotSupportedError"}}
2405+
{{DOMException}} and return |p|.
2406+
</li>
24022407
<li>
24032408
An implementation MAY reject |p| with
24042409
a {{"NotSupportedError"}} {{DOMException}}
@@ -2412,11 +2417,6 @@ <h3><dfn>Writing or pushing content</dfn></h3>
24122417
requested operation.
24132418
</p>
24142419
</li>
2415-
<li>
2416-
If the <a>obtain permission</a> steps return `false`, then
2417-
reject |p| with a {{"NotAllowedError"}} {{DOMException}} and
2418-
abort these steps.
2419-
</li>
24202420
<li>
24212421
Let |output| be the notation for the <a>NDEF message</a>
24222422
to be created by UA, as the result of passing
@@ -3419,18 +3419,6 @@ <h3><dfn>Writing or pushing content</dfn></h3>
34193419
</li>
34203420
</ol>
34213421
</li>
3422-
<li>
3423-
If there is no underlying <a>NFC Adapter</a>, or if a connection
3424-
cannot be established, then reject |p| with a
3425-
{{"NotSupportedError"}} {{DOMException}}
3426-
and return |p|.
3427-
</li>
3428-
<li>
3429-
If the UA is not allowed to access the underlying <a>NFC Adapter</a>
3430-
(e.g. a user preference), then reject |p| with a
3431-
{{"NotReadableError"}} {{DOMException}}
3432-
and return |p|.
3433-
</li>
34343422
<li>
34353423
If |reader|.<a>[[\Signal]]</a>'s [= AbortSignal/aborted flag =] is
34363424
set, then reject |p| with a {{"AbortError"}} {{DOMException}}
@@ -3460,6 +3448,18 @@ <h3><dfn>Writing or pushing content</dfn></h3>
34603448
reject |p| with a {{"NotAllowedError"}} {{DOMException}} and
34613449
abort these steps.
34623450
</li>
3451+
<li>
3452+
If there is no underlying <a>NFC Adapter</a>, or if a connection
3453+
cannot be established, then reject |p| with a
3454+
{{"NotSupportedError"}} {{DOMException}}
3455+
and return |p|.
3456+
</li>
3457+
<li>
3458+
If the UA is not allowed to access the underlying <a>NFC Adapter</a>
3459+
(e.g. a user preference), then reject |p| with a
3460+
{{"NotReadableError"}} {{DOMException}}
3461+
and return |p|.
3462+
</li>
34633463
<li>
34643464
Add |reader| to the <a>activated reader objects</a>.
34653465
</li>

0 commit comments

Comments
 (0)