Diff

Differences From Artifact [94b1497683]:

To Artifact [3365edf925]:


311
312
313
314
315
316
317

318
319
320



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
}

function cackeyInit() {
	var elementEmbed;

	/* Verify that we can register callbacks */
	if (!chrome.certificateProvider) {

		console.error("This extension only works on ChromeOS!");

		return;



	}

	if (cackeyHandle != null) {
		return;
	}

	elementEmbed = document.createElement('embed');
	elementEmbed.type = "application/x-pnacl";
	elementEmbed.width = 0;
	elementEmbed.height = 0;
	elementEmbed.src = "cackey.nmf";
	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;
}

function cackeyListCertificates(chromeCallback) {
	var certificates = [];

	certificates.push(
		{







>
|

|
>
>
>
















|

|

|







311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
}

function cackeyInit() {
	var elementEmbed;

	/* Verify that we can register callbacks */
	if (!chrome.certificateProvider) {
		if (!GoogleSmartCard.IS_DEBUG_BUILD) {
			console.error("This extension only works on ChromeOS!");

			return;
		} else {
			console.log("This extension only works on ChromeOS, but you appear to be debugging it -- trying anyway.");
		}
	}

	if (cackeyHandle != null) {
		return;
	}

	elementEmbed = document.createElement('embed');
	elementEmbed.type = "application/x-pnacl";
	elementEmbed.width = 0;
	elementEmbed.height = 0;
	elementEmbed.src = "cackey.nmf";
	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);

	cackeyHandle = elementEmbed;

	document.body.appendChild(cackeyHandle)

	new GoogleSmartCard.PcscNacl(cackeyHandle);
}

function cackeyListCertificates(chromeCallback) {
	var certificates = [];

	certificates.push(
		{