This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The onpeerfound event handler of the MozNFC interface is called when a MozNFCPeer is detected.

The application has to be running on the foreground (decided by System app) to receive this event.

The default action of this event is to dispatch the event in System app again, and System app will run the default UX behavior (like vibration). So if the application would like to cancel the event, the application should call event.preventDefault() or return false in this event handler.


attribute EventHandler onpeerfound;


peer : The NFCPeer object.

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, lgarner, teoli, kscarfone, allstars.chh
 Last updated by: chrisdavidmills,