Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instance of IActiveScript, that implements the IE9's JavaScript engine (“Chakra”), works in a Quirks mode

By creating an instance of IActiveScript on the basis of CLSID "{16d51579-a30b-4c8b-a276-0ff4dc41e755}" (as described here), we get IE9's JavaScript engine, which works in a Quirks mode. Unfortunately, in the Quirks mode is not supported ECMAScript 5.

Does anyone know how to create an instance of the IActiveScript for the “Chakra”, that works in the IE9 standards mode?

like image 396
Andrey Taritsyn Avatar asked Sep 16 '12 16:09

Andrey Taritsyn


1 Answers

Cast your IActiveScript to IActiveScriptProperty then call SetProperty with SCRIPTPROP_INVOKEVERSIONING on it like that:

CComQIPtr<IActiveScriptProperty> property = jscript;
CComVariant version(SCRIPTLANGUAGEVERSION_5_8 + 1); // = 3
hr = property->SetProperty(SCRIPTPROP_INVOKEVERSIONING, nullptr, &version);
like image 196
sms Avatar answered Oct 21 '22 04:10

sms