diff --git a/index.html b/index.html index 01fe5c1..bb36bca 100644 --- a/index.html +++ b/index.html @@ -730,7 +730,7 @@ class="example">
Filtering of relevant data sources can be done by the use of
- the NFCWatchOptions. Below we accept URL with
To describe which messages an application is interested in, the
- NFCWatchOptions dictionary is used:
+ NFCReaderOptions dictionary is used:
- The NFCWatchOptions.url property
+ The NFCReaderOptions.url property
denotes the URL pattern which is used for matching the
Web NFC Id of Web NFC messages which are being read.
The default value
- The NFCWatchOptions.recordType property
+ The NFCReaderOptions.recordType property
denotes the enum value which is used for matching the
+ the NFCReaderOptions. Below we accept URL with
"/mypath/mygame/"
in its path from "mygame.com"
domain and its subdomains. When we read the data, we immediately update
the game progress by issueing a push with a custom NDEF data layout.
@@ -1430,10 +1430,11 @@ The NFCRecordType enum
Promise<void> push(NFCMessageSource message, optional NFCPushOptions options);
};
- [Constructor(), SecureContext, Exposed=Window]
+ [Constructor(optional NFCReaderOptions options), SecureContext, Exposed=Window]
interface NFCReader : EventTarget {
- Promise<void> watch(optional NFCWatchOptions options);
attribute EventHandler onreading;
+
+ Promise<void> watch();
};
[Constructor(DOMString type, NFCReadingEventInit nfcReadingEventInitDict), SecureContext, Exposed=Window]
@@ -1678,28 +1679,28 @@ The NFCPushTarget enum
- The NFCWatchOptions dictionary
+ The NFCReaderOptions dictionary
- dictionary NFCWatchOptions {
+ dictionary NFCReaderOptions {
USVString url = "";
NFCRecordType recordType;
USVString mediaType = "";
- NFCWatchMode mode = "web-nfc-only";
+ NFCAccept accept = "web-nfc-only";
AbortSignal? signal;
};
""
means that no matching happens.
recordType
property of each
@@ -1708,19 +1709,19 @@ The NFCPushTarget enum
NFC watch algorithm.
- The NFCWatchOptions.mediaType property
+ The NFCReaderOptions.mediaType property
denotes the match pattern which is used for matching the
mediaType
property of each
NFCRecord
object in a Web NFC message.
The default value ""
means that no matching happens.
- The NFCWatchOptions.mode property denotes the
- NFCWatchMode
value telling whether only
+ The NFCReaderOptions.accept property denotes the
+ NFCAccept
value telling whether only
Web NFC content or any NFC content will be watched.
- The NFCWatchOptions.signal property allows to abort + The NFCReaderOptions.signal property allows to abort the watch.
@@ -1742,10 +1743,10 @@
This enum defines the set of known values denoting whether
watch()
operation should
@@ -1753,7 +1754,7 @@
- enum NFCWatchMode { + enum NFCAccept { "web-nfc-only", "any" }; @@ -1771,7 +1772,48 @@The NFCWatchMode enum
are dispatched. -
+
NFCReader
object.
+ "url"
, set
+ reader.[[\Url]] to value.
+ "recordType"
, set
+ reader.[[\RecordType]] to value.
+ "mediaType"
, set
+ reader.[[\MediaType]] to value.
+ "accept"
, set
+ reader.[[\Accept]] to value.
+ "signal"
, set
+ reader.[[\Signal]] to value.
+ @@ -2632,8 +2674,8 @@
- An NFC watch is referring to a tuple of a Promise
,
- and a NFCWatchOptions
dictionary.
+ An NFC watch refers to a tuple of a Promise
,
+ and an NFCReader
instance.
The section
@@ -2656,11 +2698,8 @@ The NFCWatchMode enum
Let reader_instance be the NFCReader instance.
"NotSupportedError"
and return p.
"NotSupportedError"
and return p.
String
+ If the reader_instance.[[\Url]] is not an empty String
and it is not a valid URL pattern, throw "SyntaxError"
exception and return p.
"any"
- NFCWatchMode
is used, then also include in this
+ NFCAccept
is used, then also include in this
information that the origin is requesting to read not only
NFC content meant for web pages, but any NFC content.
@@ -2974,39 +3013,36 @@ NFCWatchOptions
- saved with watch.
- "web-nfc-only"
and
+ If reader_instance.[[\Accept]] is "web-nfc-only"
and
message.url is null, skip to the next
NFC watch.
"any"
,
- set options.url to ""
.
+ Otherwise, if reader_instance.[[\Accept]] is "any"
,
+ set reader_instance.[[\Url]] to ""
.
String
invoke
URL pattern match
- algorithm, providing options.url as a URL pattern and
+ algorithm, providing reader_instance.[[\Url]] as a
+ URL pattern and
message.url as a Web NFC Id
. If
URL pattern match
algorithm returns false
, skip to the next NFC watch.
""
and it is not
- equal to any record.mediaType where record is
+ If reader_instance.[[\MediaType]] is not ""
and
+ it is not equal to any record.mediaType where record is
an element of message, skip to the next NFC watch.
"reading"
at reader_instance
using NFCReadingEvent with its message
attribute
initialized to message.