Have a look at modutil. Mozilla used to have a JS API, but its going to be removed on next releases.
How can I load a PKCS#11 device in Firefox through a code/script?
-
20-06-2023 - |
Question
I'm trying to automate authentication with smart cards for a web app for which I'm required to use Selenium. When I create a new driver for Firefox, the browser doesn't have the PKCS#11 dll loaded for the smart card I'm using. Is there any way I can add this through a program/script of some sort? I've found a script for the same at http://support.gemalto.com/index.php?id=how_can_register_the_pkcs11, but it's for an older version of Firefox and is not supported anymore.
P.S: I'm using C# as well as PowerShell.Solution
OTHER TIPS
U can use modutil functions in your code and add to secmod.db database.
U can use function as NSS_Initialize(moduleSpec, "", "", NULL , 0); where modulespec is path to your secmod.db database. and then use SECMOD_AddNewModule function to add to database.
There's also https://github.com/open-eid/firefox-pkcs11-loader but this is also among endangered species, because of the removal of the used API-s.