6

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?

Community
  • 1
  • 1
Andrey Taritsyn
  • 1,286
  • 11
  • 26
  • I don't know if this works for sure but check out this interface and see if it can give you what you want: http://msdn.microsoft.com/en-us/library/cc512774(v=vs.94).aspx – justin.m.chase Oct 15 '12 at 22:54

2 Answers2

2

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);
skuntsel
  • 11,346
  • 11
  • 41
  • 64
sms
  • 924
  • 8
  • 18
  • I did this but Array.forEach is not there anyway. Microsoft JScript 11.0.16384 Object doesn't support property or method 'forEach' Src: JavaScript runtime error Error:0 Scode:800a01b6 – Danil Oct 29 '19 at 06:21
0

I believe the CLSID is 16d51579-a30b-4c8b-a276-0ff4dc41e755. There's all sorts of great information on the Active Script and JScript interfaces here, especially for those working with C#.

0x1mason
  • 699
  • 7
  • 19