Windows 11 22H2 has a different way of using the JS engine?

Julie Jiang 6 Reputation points
2022-11-02T01:24:42.513+00:00

Dear support,

Our company has a solution built on a WebBrowser that will use the JS engine. After upgrading to Windows 11 22H2, we found that the solution behaves differently from before. We did some research, and then found that Windows 11 22H2 has a different way of using the JS engine from the previous versions:

  1. Before Windows 11 22H2, when the WebBrowser calls the JS engine, it loads jscript9.dll and jscript.dll for the job;
  2. In Windows 11 22H2, when when the WebBrowser calls the JS engine, it loads jscript9.dll and jscriptlegacy.dll.

Due to this difference, our solution has practically stopped working. (We tried a few solutions, but the result is not good).

We believe there is little chance for you to change the current behavior of Windows 11 22H2... So, can you advise us how it is possible for us to change our solution to still use the old way in Windows 11 22H2 (when the WebBrowser calls the JS engine, it loads jscript9.dll and jscript.dll)?

Best regards,

Julie

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,027 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,762 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,925 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Julie Jiang 6 Reputation points
    2022-11-03T05:05:15.447+00:00

    Yes, I believe there is something unique about our product. It is based on COM, and uses Webbrowser control to load JavaScript. There are many JavaScript objects in the application. Each JavaScript object is associated with a C++ object. The C++ object stores the IDispath pointer of the JavaScript object, so that it is possible for the C++ object to directly call the JavaScript object.
    Before 22H2, the JavaScript object that IDispatch points to stays valid during the lifetime of the JavaScript object.
    However in 22H2, the JavaScript object becomes a temp object, and gets destroyed by the JavaScript engine after it is passed as parameter to the C++ object. And then if the C++ object wants to call the JavaScript object, the call would fail because it cannot find the JavaScript object.
    Then we tracked the calls, and found that there is a difference in the files being loaded when the WebBrowser calls the JavaScript engine (as provided in the earlier description, from jscript9.dll and jscript.dll, to jscript9.dll and jscriptlegacy.dll).

    Best regards,
    Julie


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.