IActiveScript APIs. Everybody knows that!” That’s true, but the
IActiveScript APIs have two problems:
- They are COM based and require extensive use of
IActiveScriptinterfaces. It talks to IE using a set of private (and IE-specific) interfaces.
- The JsRT APIs are part of IE11 and will be supported on any operating system that has IE11 installed on it. RIght now, that means Windows 8.1 and Windows Server 2012 R2. Once IE11 is released for them, it will also mean Windows 7 and Windows Server 2008 R2.
- The Windows 8.1 SDK (included with the Visual Studio 2013 preview) includes the new header file
jsrt.hand export library file
jsrt.libwhich you can use to compile against in C/C++ projects.
- We don’t have an official CLR wrapper at this point, but we will be providing a code sample shortly that wraps all the JsRT APIs with P/Invoke calls.
- The JsRT APIs are not supported in Windows Runtime applications. Because the Windows Runtime itself hosts Chakra, there are a number of important technical issues having to do with the way the system hosting and application hosting could interact that need to be solved. We won’t have solutions for these issues in the Windows 8.1 timeframe, unfortunately.
We’ll also be putting up code samples that show off all the basics of hosting Chakra, including some side benefits that you get for free from the rest of the Microsoft ecosystem:
- The Visual Studio script debugger (or, really, any
IActiveScriptdebugger) will work with a Chakra host. This includes breakpoints, locals inspection, stepping, etc. as well as some exciting new features for IE11 that I’ll talk about later.
As you can see, there are a lot of capabilities available when you use Chakra inside of your application. This is just the introductory post, I’ll be talking in more detail in the coming weeks about all the cool things you can do with the runtime. But in the meantime, download the Windows 8.1 preview and the Visual Studio 2013 preview and get cracking!
You can always reach me on Twitter here.
Pingback: JsRT Samples and Documentation | Panopticon Central
This is quite a co-incidence. Just yesterday, I was considering choices for an embedded scripting language, and was wondering if Chakra was supported by Active Scripting.
Sadly, I won’t be able to use JsRT, as my requirement is immediate, and I need to support Windows 7 (and unofficially XP) today.
Chakra does support Active Scriping today (ok, it’s not official, and jsRT is better …), you can just use chakra’s COM CLSID directly instead of getting the class from the “JScript” progid. It’s exactly the same story, 32-bit and 64-bit. Check this link for more : http://stackoverflow.com/questions/4744105/parse-and-execute-js-by-c-sharp
Unfortunately, the IActiveScript support in Chakra is tailored (and tested) only towards what IE needed to work. There are many pieces of it that are incomplete or don’t work to spec (for example, http://stackoverflow.com/questions/17472638/error-adding-scriptitem-codeonly-symbol-using-ie9-js-engine-chakra), so it’s definitely caveat emptor. And no guarantee of support. 🙂
Are these APIs available on Windows Phone 8 and 8.2 as well?
Unfortunately, no, they aren’t available on the phone at this time.