Changes

Jump to: navigation, search

WebAPI/Security/WebNFC

2,227 bytes added, 17:52, 27 March 2015
gecko - dom parts
"NFC:CloseResponse"
];
 
 
=== DOM parts ===
Child Code
* https://dxr.mozilla.org/mozilla-central/source/dom/nfc/nsNfc.js
* https://dxr.mozilla.org/mozilla-central/source/dom/nfc/NfcContentHelper.js
Parent code
* https://dxr.mozilla.org/mozilla-central/source/dom/nfc/gonk/Nfc.js
 
 
IPC names:
const NFC_IPC_MSG_ENTRIES = [
{ permission: null,
messages: ["NFC:AddEventListener",
"NFC:QueryInfo",
"NFC:CallDefaultFoundHandler",
"NFC:CallDefaultLostHandler"] },
 
{ permission: "nfc",
messages: ["NFC:ReadNDEF",
"NFC:WriteNDEF",
"NFC:MakeReadOnly",
"NFC:Format",
"NFC:Transceive"] },
 
{ permission: "nfc-share",
messages: ["NFC:SendFile",
"NFC:RegisterPeerReadyTarget",
"NFC:UnregisterPeerReadyTarget"] },
 
{ permission: "nfc-manager",
messages: ["NFC:CheckP2PRegistration",
"NFC:NotifyUserAcceptedP2P",
"NFC:NotifySendFileStatus",
"NFC:ChangeRFState",
"NFC:SetFocusApp"] }
];
 
 
'''Session Handling'''<br/>
Session token is set in Nfc.js. The session token is broadcast via a ”nfc-manager-tech-discovered” message. Only the app with nfc-manage can recieve this (is the system app). The system does different things based on the tech type, but basically, the app that ends up talking to the tag would call navigator.mozNfc.getNFCTag(sessiontoken). For peer connections, this is the system app itself. For other NDEF types, the system app starts a web activity, which includes the session token.
 
So, some important notes from this behavior:
Any web app could claim to register a web activity handler for a specific ndef type
 
 
"activities": {
"nfc-tech-lost": {
"filters": {
"type": "info"
}
},
"nfc-ndef-discovered": {
"filters": {
"type": ["device", "empty", "external-type", "mail",
"smartposter", "smartposter-action",
"text/vcard", "text",
"webcontacts/contact", "webcontacts/email",
"webtelephony/number", "websms/sms",
"uri",
"*"
]
}
}
}
 
 
 
 
 
Confirm
152
edits

Navigation menu