-
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
Join NDEFReader and NDEFWriter #601
Conversation
refers to w3c/web-nfc#601 Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Quick question: Is it clear for web developers that const ndef = new NDEFReader();
ndef.onerror = event => {
/* Was there an error while writing? */
}
ndef.write('hello world'); |
Good question, we need to clarify that with the two objects merged. |
So should we rename |
0acd86d
to
4aafd69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind also updating the the EXPLAINER.md file and other files where NDEFWriter is referenced?
726725f
to
dbb9a52
Compare
Amended the TypeScript definition to also remove |
refers to w3c/web-nfc#601 Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
@beaufortfrancois On the chromium implementation, there are 2 places where onerror is fired. and which are 2 different cases, right? |
Since we merged NDEFReader (which had an In the impl Looks like since filters are gone, we have only one reader, and |
Argh I see now... You're right @arskama, the first one "NDEFReader::OnMojoConnectionError()" is not per-say a reading error but an internal communication issue that can happen in Chromium. The old behaviour still triggered an error even though it was NOT specifically a reading error. With that in mind, maybe keeping Let's keep |
So that error could have happened with the write(), too. |
Do I read that correctly: it seems to reject the promise with that error and also fire an |
scan will succeed when scan has started successfully, but this error could happen way after.
it is an internal issue which "shouldn't" happen but can happen. |
OK, I will add a commit the revert to |
Question, @beaufortfrancois @kenchris With filters gone, we can still create multiple NDEFReader instances, each of which has a scan() method that operate on the same NFC HW and have an How should we handle this?
|
d0d6233
to
c8547bc
Compare
Sorry, I needed to amend since I forgot to update the explainer and the TS definitions. |
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my first feedback to get your thoughts.
index.html
Outdated
accepted by the {{NDEFWriter/write()}} method. | ||
<p>The | ||
<dfn>ndef</dfn> property is an {{NDEFReader}} object that provides | ||
<a>NDEF</a> tag read and write functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we use NFC tags consistently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, changed. I was thinking not all NFC tags were NDEF, so using "NDEF tag" was more appropriate for NDEFReader.
What does happen with code below? const promise1 = navigator.nfc.ndef.scan();
const promise2 = navigator.nfc.ndef.scan(); Which Same for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shall update Separate objects vs navigator.nfc
and Separate objects for reader/writer
sections in EXPLAINER.md
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Summarized the discussion about constructors vs navigator.nfc in #602. |
OK, now we have I will make a branch from here to explore option 2 from #602 comment. That is, This would permit later improvements, such as the The minimal delta from this point that supports the current functionality would be quite small, but let's see how |
Reverted attaching to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my feedback for the explainer.
I'll now review spec changes.
The NDEFReader onerror event handler is renamed to onreadingerror to make it clear to web developers that only NFC read errors will be fired in this event as NDEFReader and NDEFWriter will soon been merged. Note that an error message is now displayed in the devtools JS console to help web developers to diagnose issues while it was part of the error event before. This CL also removes onreadingerror event fired on MojoConnectionError as this is called if either the NFC service is unavailable in which case NDEFReader.scan() will return a rejected promise, or when NFC permission is revoked in which case the Permission API can be used to detect changes. Spec: w3c/web-nfc#601 Bug: 520391 Change-Id: I451083fb5382149e9a1e45da31e575709f190448 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#829626}
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
…readingerror, a=testonly Automatic update from web-platform-tests [WebNFC] Rename NDEFReader onerror to onreadingerror The NDEFReader onerror event handler is renamed to onreadingerror to make it clear to web developers that only NFC read errors will be fired in this event as NDEFReader and NDEFWriter will soon been merged. Note that an error message is now displayed in the devtools JS console to help web developers to diagnose issues while it was part of the error event before. This CL also removes onreadingerror event fired on MojoConnectionError as this is called if either the NFC service is unavailable in which case NDEFReader.scan() will return a rejected promise, or when NFC permission is revoked in which case the Permission API can be used to detect changes. Spec: w3c/web-nfc#601 Bug: 520391 Change-Id: I451083fb5382149e9a1e45da31e575709f190448 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#829626} -- wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171 wpt-pr: 26573
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
…readingerror, a=testonly Automatic update from web-platform-tests [WebNFC] Rename NDEFReader onerror to onreadingerror The NDEFReader onerror event handler is renamed to onreadingerror to make it clear to web developers that only NFC read errors will be fired in this event as NDEFReader and NDEFWriter will soon been merged. Note that an error message is now displayed in the devtools JS console to help web developers to diagnose issues while it was part of the error event before. This CL also removes onreadingerror event fired on MojoConnectionError as this is called if either the NFC service is unavailable in which case NDEFReader.scan() will return a rejected promise, or when NFC permission is revoked in which case the Permission API can be used to detect changes. Spec: w3c/web-nfc#601 Bug: 520391 Change-Id: I451083fb5382149e9a1e45da31e575709f190448 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#829626} -- wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171 wpt-pr: 26573
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
…readingerror, a=testonly Automatic update from web-platform-tests [WebNFC] Rename NDEFReader onerror to onreadingerror The NDEFReader onerror event handler is renamed to onreadingerror to make it clear to web developers that only NFC read errors will be fired in this event as NDEFReader and NDEFWriter will soon been merged. Note that an error message is now displayed in the devtools JS console to help web developers to diagnose issues while it was part of the error event before. This CL also removes onreadingerror event fired on MojoConnectionError as this is called if either the NFC service is unavailable in which case NDEFReader.scan() will return a rejected promise, or when NFC permission is revoked in which case the Permission API can be used to detect changes. Spec: w3c/web-nfc#601 Bug: 520391 Change-Id: I451083fb5382149e9a1e45da31e575709f190448 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#829626} -- wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171 wpt-pr: 26573
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236}
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236}
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236}
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094
This change renames NDEFReader.prototype.onerror to NDEFReader.prototype.onreadingerror, per the spec change at w3c/web-nfc@a71bff9 (w3c/web-nfc#601).
…error (#7613) * Rename NDEFReader.p.onerror to onreadingerror This change renames NDEFReader.prototype.onerror to NDEFReader.prototype.onreadingerror, per the spec change at w3c/web-nfc@a71bff9 (w3c/web-nfc#601). * Re-sort NDEFReader subfeatures to make linter glad
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <harakenchromium.org> Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: François Beaufort <beaufort.francoisgmail.com> Commit-Queue: François Beaufort <beaufort.francoisgmail.com> Cr-Commit-Position: refs/heads/master{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094 UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <harakenchromium.org> Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: François Beaufort <beaufort.francoisgmail.com> Commit-Queue: François Beaufort <beaufort.francoisgmail.com> Cr-Commit-Position: refs/heads/master{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094 UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
… a=testonly Automatic update from web-platform-tests web-nfc: Merge NDEFWriter in NDEFReader NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <harakenchromium.org> Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: François Beaufort <beaufort.francoisgmail.com> Commit-Queue: François Beaufort <beaufort.francoisgmail.com> Cr-Commit-Position: refs/heads/master{#832236} -- wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002 wpt-pr: 26094 UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
The NDEFReader onerror event handler is renamed to onreadingerror to make it clear to web developers that only NFC read errors will be fired in this event as NDEFReader and NDEFWriter will soon been merged. Note that an error message is now displayed in the devtools JS console to help web developers to diagnose issues while it was part of the error event before. This CL also removes onreadingerror event fired on MojoConnectionError as this is called if either the NFC service is unavailable in which case NDEFReader.scan() will return a rejected promise, or when NFC permission is revoked in which case the Permission API can be used to detect changes. Spec: w3c/web-nfc#601 Bug: 520391 Change-Id: I451083fb5382149e9a1e45da31e575709f190448 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#829626} GitOrigin-RevId: 5d80d77e62168984affeee6ac9e335a788a997df
NDEFWriter and NDEFReader share a lot of similar features and a writing device, will also read. Therefore it was decided to simplify NDEF functionality, and to have only one class called NDEFReader, which can read and write. refers to w3c/web-nfc#601 Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now used in idl extended attributes, their usages may be higher now as they were fired after user granted permission. Bug: 1131141 Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208 Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: François Beaufort <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832236} GitOrigin-RevId: c86f47d0879af24702bbfb7ba5410432c7ce3fe1
Re-applying #568.
Preview | Diff