The implementation of Web NFC in Chromium consists of two main parts:
The Blink NFC module communicates with the browser adaptation through NFC Mojo interface defined in the
services/device/public/mojom/nfc.mojom file and implemented by the
NDEFReader is the primary interface of Web NFC. The NDEFReader interface has both, write and scan methods:
third_party/blink/web_tests/external/wpt/web-nfc/and are a mirror of the web-platform-tests GitHub repository.
Web NFC API can be only accessed by top-level secure browsing contexts that are visible. User permission is required to access NFC functionality. Web NFC specification addresses security and privacy topics in “Security and Privacy” chapter.
The device service provides no support for permission checks. When the renderer process requests access to NFC, this request is proxied through the browser process by NfcPermissionContext which is responsible for checking the permissions granted to the requesting origin.
At the time of writing, only Android platform is supported.
Please refer to the design documentation for more details.