Latest documentation update:
The ClientGlobalContext.js.aspx page is deprecated and scheduled to be unavailable after April 1, 2022. Alternative methods to access global context information will be available by December, 2021.
On this particular piece, so far nothing documented as workaround or alternate solution from Microsoft. I created a github issue for the assistance and it is still open.
Between, I came to know about one of the MS employee unofficial side project and code sample from this blog. That is also about to be confirmed as supported.
A lot of organizations use ClientGlobalContext.js.aspx in HTML web
resources, and this means you will want to upgrade those HTML web
resources that utilize the ClientGlobalContext.js.aspx library as soon
as possible.
If you are embedding HTML web resources in Dynamics 365 / Power Apps
forms, you may want to look at using getContentWindow.
If you have stand-alone HTML web resources, or if you are embedding in
forms and would like a neat way to swap out
ClientGlobalContext.js.aspx with a new library, Microsoft employee
Christopher Nichols has built a solution that may be of interest to
you.
Christopher has a nice unofficial side project going on called
mock-xrm that, as you can imagine, mocks xrm. This means we can call
our Xrm functionality from within web resources that instead of the
legacy aspx page.
All we have to do is just download the Xrm.min.js
file as web resource and this has to be referred in our HTML web resource to consume Xrm
the same way as earlier.
We can keep a close eye on this library and github issue for further updates and concrete communication.