Yes, but you'd need to implement a compatible API for it to call. And both ActiveX and NPAPI expect access to privileged APIs not normally available to sandboxed Javascript code. So you'd either need browser support for equivalent privileged APIs for Javascript or some kind of emulation layer that fakes the access those APIs expect.