[web-nfc] Attach to navigator (#602)

zolkis has just created a new issue for https://github.com/w3c/web-nfc:

== Attach to navigator ==
This is to record the arguments in a discussion about merging NDEF reader and writer objects and removing filters, coming from Origin Trials feedback.
That resulted in using only one NDEF reader and one writer promise being part of NFC state (per settings object).
It means we don't need multiple NDEFReader objects, since only the one owning the last called scan() will be active at a time, the previous ones need rejected (with AbortError).
That in turn popped the question whether should we attach to the Navigator object, as Web Bluetooth, Web USB etc are doing.
Our explainer listed arguments for using NDEFReader() constructors, since it allows implementing the same API in Node.js, and it is aligned with newer APIs such as Generic Sensor.

On the other hand, Web NFC is closer to Web Bluetooth and Web USB than to Generic Sensors, therefore the Editors decided to attach to the Navigator object and use `navigator.nfc.ndef` of type NDEFReader (that would handle scans and writes).

In the future, when other than NDEF tech might be supported, they could be hosted under `navigator.nfc` as well.
 

Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/602 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 13 October 2020 15:47:36 UTC