-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tag read only #558
Comments
This would also be useful for my use cases. |
I'm currently playing around with this and I think this is a crucial feature. Let's imagine I have NFC Tags in a Museum and anyone would be able to overwrite the content. That would be quite bad. But looking through the Android specification I've seen NFC as a standard already has such a feature. So if i write an NFC Tag with readOnly from an Android app, I guess WebNFC could not just overwrite that content, right? If thats the case, this would be a workaround for now.. |
@kenchris What are your thoughts? Thanks for the feedback @nico-martin ! [SecureContext, Exposed=Window]
interface NDEFReader : EventTarget {
...
Promise<undefined> makeReadOnly()
}; Note that this addition would be pretty simple indeed on Android, but not necessarily on iOS currently. |
I am totally fine with this! It can return a promise and just reject if not supported |
Maybe a general NFC-question: How can I revoke the readOnly flag? Is this possible with NFC Tags? |
This NFC operation is a one-way process and cannot be reverted for NFC tags. |
Ok. Maybe this could lead to some confusion for people that are not familiar with this. const ndef = new NDEFReader();
try {
await ndef.write({
records: [{ recordType: "url", data: "https://w3c.github.io/web-nfc/" }]
});
await ndef.makeReadOnly({
allowIrreversibleOperation: true
});
} catch (e) {
console.log("Something went wrong.", e);
};
|
The Chrome UI could show trusted UI explaining the risk and allowing the user to cancel or proceed |
Sure. That makes sense. |
I've started a spec PR to address web developers need to make NFC tags read only at #632. Thoughts are welcome! |
And I've just sent the "intent to prototype" in Chromium: https://groups.google.com/a/chromium.org/g/blink-dev/c/iyljeGnIct8 |
FYI Making an NFC tag read-only is now possible in latest Chrome Canary for Android:
Feedback is always welcome! See https://twitter.com/quicksave2k/status/1471060640131436546 |
This feature is shipping in Chrome 100. |
Hi!
I was wondering how can we "lock" the NFC tag after writting or make it read only? I see that this some security specification, but didn't found a way to do it using Write or another method.
Thanks!
The text was updated successfully, but these errors were encountered: