Intent to experiment: Web NFC

1105 views
Skip to first unread message

François Beaufort 🇫🇷

unread,
Jan 13, 2020, 5:56:15 AM1/13/20
to blink-dev

Contact emails

fbea...@chromium.org, rei...@chromium.org, rijubrat...@intel.com, kenneth.r.c...@intel.com, zolta...@intel.com, leon...@intel.com


Explainer

https://github.com/w3c/web-nfc/blob/gh-pages/EXPLAINER.md

 

Spec

http://w3c.github.io/web-nfc

 

TAG Review (Requested)

https://github.com/w3ctag/design-reviews/issues/461


Summary

Web NFC aims to provide sites the ability to read and write to NFC tags when they are brought in close proximity to the user’s device (usually 5-10 cm, 2-4 inches). The current scope is limited to NDEF, a lightweight binary message format. Low-level I/O operations (e.g. ISO-DEP, NFC-A/B, NFC-F) and Host-based Card Emulation (HCE) are not supported within the current scope.


Web NFC is only available to top-level, secure browsing contexts, and origins must first request the “nfc” permission while handling a user gesture. To then perform a read or write, the web page must be visible when the user touches an NFC tag with their device. The browser uses haptic feedback to indicate a tap. Access to the NFC radio is blocked if the display is off or the device is locked. For backgrounded web pages, receiving and pushing NFC content are suspended.

 

The combination of a user-initiated permission prompt and real-world, physical movement of bringing the device over a target NFC tag mirrors the chooser pattern found in the other file and device-access APIs.

 

The functionality currently available behind a flag at chrome://flags/#enable-webnfc and this experiment represents a minimum-viable-product for this API. Issues are filed in the Blink>NFC component for remaining work.


Link to feature tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=520391


Link to Chrome launch approval bug (sorry, Googlers only)

https://bugs.chromium.org/p/chromium/issues/detail?id=1035048


Link to “Intent to Prototype” blink-dev discussion

https://groups.google.com/a/chromium.org/d/topic/blink-dev/dIbUdDU9a6E/discussion


Goals for experimentation

We have already received some feedback on the API surface and implementation from web developers who have tried it behind a flag. The goal for this Origin Trial is to get feedback on the shape of the API, the new permission prompt flow, and whether the current scope of the specification is sufficient for their use cases.

 

We expect to react to developer feedback and work on completing the implementation during the experiment period.


A partner has expressed strong interest in participating in the Origin Trial.

Experimental timeline

The experiment begins with the release of Chrome 81 to beta-channel and ends when Chrome 84 is shipped to stable-channel (replacing Chrome 83 which will be the last version with the experiment enabled).


Any risks when the experiment finishes?

None. Sites should be aware that this is experimental functionality that is not guaranteed to be available after the experiment ends.


Ongoing technical constraints

None.


Will this feature be supported on all five Blink platforms supported by Origin Trials (Windows, Mac, Linux, Chrome OS, and Android)?
No. Support will be for Android only initially (excludes WebView).


Link to entry on the feature dashboard

https://www.chromestatus.com/features/6261030015467520


Links to demos
https://web-nfc-demo.glitch.me/ featured in https://twitter.com/ChromiumDev/status/1206890116964323328

https://kenchris.github.io/webnfc-groceries featured in https://twitter.com/kennethrohde/status/874970608798494720

Yoav Weiss

unread,
Jan 13, 2020, 6:04:05 AM1/13/20
to François Beaufort 🇫🇷, blink-dev
LGTM to experiment M81-M83

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5L5RTSdebK%3DiOVBwJzs-o6YRcuCNoHGzWphc1RMneqKFA%40mail.gmail.com.

François Beaufort 🇫🇷

unread,
Oct 13, 2020, 4:51:06 AM10/13/20
to Jonas Meidel, blink-dev, yo...@yoav.ws
Web NFC origin trial ended in Chrome 84. It's not possible to get tokens anymore.
However you can still enable the "experimental-web-platform-features" flag in chrome://flags to run more tests on Android.

We're in the process of addressing web developers feedback we've gathered during the origin trial.
See https://github.com/w3c/web-nfc/pull/601 for instance.

When it's done, we'll likely experiment again and will update this thread.

Hopefully this helped,
Francois.

On Tue, Oct 13, 2020 at 10:39 AM Jonas Meidel <jonas...@gmail.com> wrote:
I'd like to know if there is any chance to get a Token for webNFC

We know that the Projekt has already ended, but we'd still like to run a few tests.

Or is there any planing on supporting WebNFC otherwise? 

François Beaufort 🇫🇷

unread,
Oct 13, 2020, 5:19:13 AM10/13/20
to Jonas Meidel, blink-dev, yo...@yoav.ws
I'd guess your website is not served over https.

On Tue, Oct 13, 2020 at 11:15 AM Jonas Meidel <jonas...@gmail.com> wrote:
Alright but with enabled "experimental-web-platform-features" on I can't find an Reader on my own website. 

Im useing an Andriod phone and google Chrome. I enabled the flag and made a function :
                        if ('NDEFReader' in window) { 
/* Scan NFC tags */
alert("NDEFReader Found");
} else {
alert("No NDEFReader Found");
}
I always get "No NDEFReader Found" 

What do I do wrong? 

I thought it'd be about the Token, but I'm getting the feeling that it should work like that.

François Beaufort 🇫🇷

unread,
Oct 13, 2020, 5:25:39 AM10/13/20
to Jonas Meidel, blink-dev, yo...@yoav.ws
Serving your website over https will make it work with the flag.
https://googlechrome.github.io/samples/web-nfc/ should work for instance.

On Tue, Oct 13, 2020 at 11:23 AM Jonas Meidel <jonas...@gmail.com> wrote:



So there is no way to make WebNFC work at all? 

Jonas Meidel

unread,
Oct 13, 2020, 10:49:47 AM10/13/20
to blink-dev, François Beaufort, blink-dev, yo...@yoav.ws, Jonas Meidel



So there is no way to make WebNFC work at all? 

Jonas Meidel

unread,
Oct 13, 2020, 10:49:58 AM10/13/20
to blink-dev, François Beaufort, blink-dev, yo...@yoav.ws, Jonas Meidel
Alright but with enabled "experimental-web-platform-features" on I can't find an Reader on my own website. 

Im useing an Andriod phone and google Chrome. I enabled the flag and made a function :
                        if ('NDEFReader' in window) { 
/* Scan NFC tags */
alert("NDEFReader Found");
} else {
alert("No NDEFReader Found");
}
I always get "No NDEFReader Found" 

What do I do wrong? 

I thought it'd be about the Token, but I'm getting the feeling that it should work like that.
François Beaufort schrieb am Dienstag, 13. Oktober 2020 um 10:51:06 UTC+2:

Jonas Meidel

unread,
Oct 13, 2020, 10:50:22 AM10/13/20
to blink-dev, François Beaufort, blink-dev, yo...@yoav.ws, Jonas Meidel
According to https://developer.mozilla.org/en-US/docs/Web/API/NDEFReader/NDEFReader NDEFReader is Compatible with no Browser. 

But it obviously works with the website. Why is it saying that ?

Jonas Meidel

unread,
Oct 13, 2020, 10:50:37 AM10/13/20
to blink-dev, François Beaufort, blink-dev, yo...@yoav.ws, Jonas Meidel
Its finally working. You were right, I just had to get an https URL and it just works.

Thank you very much 

I'm so happy that its finally working :) 

Jonas Meidel

unread,
Oct 13, 2020, 10:51:47 AM10/13/20
to blink-dev, yo...@yoav.ws, blink-dev, François Beaufort
I'd like to know if there is any chance to get a Token for webNFC

We know that the Projekt has already ended, but we'd still like to run a few tests.

Or is there any planing on supporting WebNFC otherwise? 

yo...@yoav.ws schrieb am Montag, 13. Januar 2020 um 12:04:05 UTC+1:

Joe Medley

unread,
Oct 14, 2020, 4:26:29 PM10/14/20
to François Beaufort 🇫🇷, Jonas Meidel, blink-dev, yo...@yoav.ws
Apologies. The Chrome Status entry still had the origin trial label on it even though there was no origin trial. I've changed its status back to "In developer trial (Behind a flag)".
Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.


François Beaufort 🇫🇷

unread,
Oct 15, 2020, 6:14:27 AM10/15/20
to Joe Medley, Jonas Meidel, blink-dev, yo...@yoav.ws
-others

Thank you!

Sead Memic

unread,
Nov 9, 2020, 11:17:14 AM11/9/20
to blink-dev, François Beaufort, Jonas Meidel, blink-dev, yo...@yoav.ws, Joe Medley
I understand that the trial has expired, and the feedback is being processed.

Will there be a new trail after the feedback has been reviewed?

Is there any expectation when this will be shipped to stable Chrome?

Op donderdag 15 oktober 2020 om 12:14:27 UTC+2 schreef François Beaufort:

Tadas B.

unread,
Nov 16, 2020, 5:55:02 PM11/16/20
to blink-dev, Sead Memic, François Beaufort, Jonas Meidel, blink-dev, yo...@yoav.ws, Joe Medley
 Hi, 

 I wan to build a web site  for my company that needs to read NFC so I don't understand -  is there any risk that this feature will be removed from Chrome in some future?


François Beaufort 🇫🇷

unread,
Dec 16, 2020, 12:35:28 AM12/16/20
to Sead Memic, blink-dev, Jonas Meidel, yo...@yoav.ws, Joe Medley
Hey, we've just an intent to ship for Web NFC at https://groups.google.com/a/chromium.org/g/blink-dev/c/aoj06_plqPc
If it gets approved, we may get Web NFC support enabled by default in Chrome 89.

I'll make sure to update https://web.dev/nfc/ when it happens.
Reply all
Reply to author
Forward
0 new messages