English 中文(简体)
How will the Chakra Jscript engine be exposed to Scripting Hosts?
原标题:

Anybody has experience with the upcoming IE9 Chakra engine? I am currently considering whether to incorporate the Microsoft s JScript engine through the Window Script Interface or using one of those open source javascript engines (tracemonkey/v8 etc).

The JScript engine is a bit too slow and Chakra looks promising. But I am not sure if it will be accessible the same way as before since Active Scripting should be deprecated.

Anybody get some idea?

最佳回答

I m not aware that ActiveScripting is deprecated - I ve seen no statement from Microsoft along those lines.

Microsoft s documentation suggests that IE9 s Javascript engine (code-named "chakra") still gets loaded by IActiveScript. Though MS does not document a ProgId or CLSID, there is a CLSID you can use:

{16d51579-a30b-4c8b-a276-0ff4dc41e755}

The C# code to load the Chakra scripting engine looks like this:

    var guid = new System.Guid("{16d51579-a30b-4c8b-a276-0ff4dc41e755}");
    Type engineType = Type.GetTypeFromCLSID(guid, true);
    var engine = Activator.CreateInstance(engineType) as IActiveScript;

In my limited tests in various micro-benchmarks, Chakra is about 2x the speed of JScript v5.8.

See also:
What is the ProgId or CLSID for IE9 s Javascript engine (code-named "Chakra")

问题回答

You may be interested in checking this out too: JavaScript Runtime Hosting

It s not ActiveScript but it gives you very low level access to Chakra in a very nice new API.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签