Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,48 @@
/* globals NfcUtils, BaseModule, Service */
'use strict';
(function() {
var NfcHandler = function (core) {
this.nfc = core.nfc;
};
/**
* @class NfcCore
*/
BaseModule.create(NfcHandler, {
name: 'NfcHandler',
_start: function nh_start() {
this.nfc.addEventListener('peerready', this);
},
handleEvent: function nh_handleEvent(evt) {
var nfcUtils = new NfcUtils();
if (evt.type !== 'peerready') {
return;
}
var currentApp = Service.query('getTopMostWindow');
if (currentApp && currentApp.isBrowser() && currentApp.config.url) {
var ndefUri = nfcUtils.parseURIString(currentApp.config.url);
this.sendNDEFMessageToNFCPeer(ndefUri, evt);
}
},
/**
* Send NDEF message to NFC peer.
* @param {MozNDEFRecord} message non-null Array of NDEF records.
* @param {Events} nfcEvent an event from mozNfc.onpeerready.
*/
sendNDEFMessageToNFCPeer:
function nh_sendNDEFMessageToNFCPeer(message, nfcEvent) {
if (!message) {
return;
}
var nfcPeer = nfcEvent.peer;
if (!nfcPeer) {
return null;
}
nfcPeer.sendNDEF(message);
}
});
}());