I've never managed to figure out how to configure extensions through the Firefox JS APIs, but installing an add-on using the internal APIs isn't too hard. I do it in my VimFX config.js[0]. Hope this is useful.
0: https://ba.ln.ea.cx/src/marsironpi/dotfiles/tree/common/.vim...