views:

44

answers:

1

I am very new to Web development, and have been writing some javascript that makes use of WScript.Shell via ActiveX. I am aware that browsers other than IE don't support ActiveX though.

After doing some digging through Google, I have discovered that I may be able to do something similar on all web kit based browsers via NPAPI. I have no idea where to even begin when it comes to this though. Is it possible to do what I am after via NPAPI? If so, where would I begin?

A: 

As long as you only care about Windows, you could simply use a NPAPI plugin to wrap the existing WScript.Shell - note however that plugins have to be embedded in the page; there is no equivalent for new ActiveXObject("..."). This also means you have to duplicate the scripting interface or write an automatic dispatcher for it.
For writing the plugin, take a look at the FireBreath project (disclaimer: i am its co-owner) which already gives you solutions for the most common tasks. If you want to do automatic dispatching for the scripting interface, take a look at ff-activex-host's implementation (in particular scriptable.h and axhost.cpp).

Georg Fritzsche