@@ -140,10 +140,18 @@ if (messageEvent.data.originalrequest.certificate) { delete cackeyCertificateToPINMap[cackeyCertificateToPINID(messageEvent.data.originalrequest.certificate)]; } } } + + if (messageEvent.data.command == "init" && messageEvent.data.status == "success") { + if (GoogleSmartCard.IS_DEBUG_BUILD) { + console.log("[cackey] Initialization completed, resending any queued messages"); + } + + cackeyInitPCSCCompleted(); + } if (messageEvent.data.id == null) { return; } @@ -668,10 +676,16 @@ "width": 350, "minWidth": 350, "height": 135, "minHeight": 135 } + }, function(uiWindow) { + if (!uiWindow) { + return; + } + + uiWindow.contentWindow.parentWindow = window; }); }); /* * Register a handler for dealing with the PCSC port being disconnected @@ -690,12 +704,10 @@ */ oldPCSCInitializationCallback = GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_; GoogleSmartCard.PcscNacl.prototype.pcscInitializationCallback_ = function(requestId, instanceId, instance, error) { oldPCSCInitializationCallback.apply(this, [requestId, instanceId, instance, error]); - cackeyInitPCSCCompleted(); - return; }; /* * Initialize global state