Search code examples
javascriptgoogle-chrome-extensionbrowsernfc

Reading NFC tags in the browser


As I was working on an E-wallet system, my boss assigned me a job to allow our agents to be able to top-up the clients' wallets by reading their NFC cards. The agents are using a web browser client to browse their CMS part of the System, I made that myself. Is it possible to read NFC through the web browser?

I thought that wouldn't be possible by writing a JavaScript code on an HTML page, but I imagine that this could be done by making a browser extension. However, I'm not sure if that's the way to go. and what would be the next.


Solution

  • Yes possible depending on a lot of factors via https://w3c.github.io/web-nfc/ but very limited support in terms of browser supported (only some Android web browsers). see https://developer.mozilla.org/en-US/docs/Web/API/Web_NFC_API

    You are also limited currently to Ndef message format as well as well as some other security limitations, which is probably not used by your NFC cards