smart_card_connector_app/src/background.js
/**
 * Called when the onConnectExternal event is received.
 * @param {!Port} port
 */
Called when the onConnectExternal event is received.
@param {!Port} port
Called when the onConnectExternal event is received . @param { !Port } port
function externalConnectionListener(port) {
  goog.log.fine(logger, 'Received onConnectExternal event');
  const portMessageChannel = new GSC.PortMessageChannel(port);
  if (portMessageChannel.messagingOrigin === null) {
    goog.log.warning(
        logger,
        'Ignoring the external connection as there is no sender specified');
    return;
  }
  messageChannelPool.addChannel(
      portMessageChannel.messagingOrigin, portMessageChannel);
  GSC.MessagingCommon.setNonFatalDefaultServiceCallback(portMessageChannel);
  createClientHandler(portMessageChannel, portMessageChannel.messagingOrigin);
}
function externalConnectionListener ( port ) { goog . log . fine ( logger , 'Received onConnectExternal event' ) ; const portMessageChannel = new GSC . PortMessageChannel ( port ) ; if ( portMessageChannel . messagingOrigin === null ) { goog . log . warning ( logger , 'Ignoring the external connection as there is no sender specified' ) ; return ; } messageChannelPool . addChannel ( portMessageChannel . messagingOrigin , portMessageChannel ) ; GSC . MessagingCommon . setNonFatalDefaultServiceCallback ( portMessageChannel ) ; createClientHandler ( portMessageChannel , portMessageChannel . messagingOrigin ) ; }
Called when the onConnectExternal event is received.
Called when the onConnectExternal event is received .
// The opener will send PC/SC commands (or garbage if it's broken) - create a // handler for processing these commands. Also add it to the pool of opened // ports, so that subscribers (like UI) will learn about this new caller.