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

3

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?

Debose answered 16/9, 2012 at 16:42 Comment(1)
I don't know if this works for sure but check out this interface and see if it can give you what you want: msdn.microsoft.com/en-us/library/cc512774(v=vs.94).aspxShuster
P
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);
Pterodactyl answered 25/6, 2015 at 19:12 Comment(1)
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:800a01b6Pilliwinks
U
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#.

Umiak answered 1/10, 2012 at 18:8 Comment(0)
E
0

Just in case people wonder: The trick of calling “SetProperty” with “SCRIPTPROP_INVOKEVERSIONING” still works. The greatest supported version is now (with jscript9.dll version 11.0.16299.2107) apparently 15.

It seems to support whatever “recent” feature is available in IE, such as “let”, “const” or “Map”, but no what is supported in Edge (such as “class”).

Ethnogeny answered 11/8, 2022 at 12:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.