@@ -313,13 +313,17 @@ function cackeyInit() { var elementEmbed; /* Verify that we can register callbacks */ if (!chrome.certificateProvider) { - console.error("This extension only works on ChromeOS!"); + if (!GoogleSmartCard.IS_DEBUG_BUILD) { + console.error("This extension only works on ChromeOS!"); - return; + return; + } else { + console.log("This extension only works on ChromeOS, but you appear to be debugging it -- trying anyway."); + } } if (cackeyHandle != null) { return; } @@ -332,15 +336,15 @@ elementEmbed.id = "cackeyModule"; elementEmbed.addEventListener('error', function(messageEvent) { console.error("Error loading CACKey PNaCl Module: " + messageEvent.data); }, true); elementEmbed.addEventListener('load', cackeyInitLoaded, true); elementEmbed.addEventListener('message', function(messageEvent) { console.log("Start message"); console.log(messageEvent.data); console.log("End message"); }, true); - new GoogleSmartCard.PcscNacl(elementEmbed); - - document.body.appendChild(elementEmbed) - cackeyHandle = elementEmbed; + + document.body.appendChild(cackeyHandle) + + new GoogleSmartCard.PcscNacl(cackeyHandle); } function cackeyListCertificates(chromeCallback) { var certificates = [];