function onInstalled() {
return browser.pkcs11.getModuleSlots("my_module");
}
function onGotSlots(slots) {
for (const slot of slots) {
console.log(`Slot: ${slot.name}`);
if (slot.token) {
console.log(`Contains token: ${slot.token.name}`);
} else {
console.log("Is empty");
}
}
}
browser.pkcs11.installModule("my_module").then(onInstalled).then(onGotSlots);pkcs11.getModuleSlots() / notebook
pkcs11.getModuleSlots()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.