admin管理员组文章数量:1335107
I'm working on a cool C# app, which uses JS a lot for our model layer. We would like to use the IE9 Chakra Javascript engine for speed improvements.
Questions:
- Can I use Chakra in C#, and interact with JS objects as COM objects? (to call functions on JS objects)
- Can I install Chakra separately from IE9? (some users do not have IE9 installed, so it would be easier if they did not have to install IE9, but just Chakra).
Thanks a lot in advance for you expertise.
I'm working on a cool C# app, which uses JS a lot for our model layer. We would like to use the IE9 Chakra Javascript engine for speed improvements.
Questions:
- Can I use Chakra in C#, and interact with JS objects as COM objects? (to call functions on JS objects)
- Can I install Chakra separately from IE9? (some users do not have IE9 installed, so it would be easier if they did not have to install IE9, but just Chakra).
Thanks a lot in advance for you expertise.
Share Improve this question edited Sep 9, 2011 at 21:29 Cheeso 193k106 gold badges485 silver badges734 bronze badges asked Mar 25, 2011 at 7:37 BodekaerBodekaer 3313 silver badges16 bronze badges2 Answers
Reset to default 7Answer to Q#1
Yes, you can interact with Javascript logic running in Chakra from C# via COM.
in Particular, from a c# program, you can startup Chakra via IActiveScript, load some Javascript/ES5 code into it, then invoke methods defined in that Javascript code via a COM IDispatch pointer.
Related:
- Will the IE10 Chakra JScript engine available as stand alone accessible from C#?
- What is the ProgId or CLSID for IE9's Javascript engine (code-named "Chakra")
Answer to Q#2
As far as I know, NO, you cannot install Chakra without installing IE9. You can design your C# app, though, to gracefully degrade to use the existing JScript engine, for puters without Chakra.
[Update] Based on Cheeso's answer it seems you can use IE9's JS engine[/Update]. However I found that V8 JavaScript engine (Chrome's JS engine) mentions that you can use V8 engine in you C++ application. Follow V8 embedder's guide to find out more. I did not find any reference where they mentioned exposing V8 functionality through COM interface, so you might not be able to use it from C#.
本文标签: javascriptCIE9 JS Engine ChakraStack Overflow
版权声明:本文标题:javascript - C# + IE9 JS Engine Chakra? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742383837a2464624.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论