How I tricked the HdxBrowserCef.exe (Chrome Browser) process into presenting itself as an Edge Browser enabling the best of both worlds.
This is a guest post, written by Dennis Smith.
We needed to be able to make a Microsoft Teams video call via our VDI. But since the Citrix HDX optimization for Microsoft Teams is still not released, my chances of getting it to work were slim to say the least. But Iโm one of those people who wonโt take โnoโ for an answer.
The situation
Our organization uses, like many production environments do, the Citrix Virtual Workspace 7.15 LTSR CU3. We host a VDI and make the VMโs available via a Netscaler.
We thought, maybe we can get it to work using the browser (teams.microsoft.com) and Citrix โBrowser Content Redirection 2.0โ, using Fernando Klurfanโs guide here;
We had set up the environment and content redirection with YouTube worked.
Under the hood
A close inspection on how this system really works was needed to find a solution to our problem. Just like flash redirection a few years ago, I know that the URL that has to be displayed is passed on via the ICA client, ahhum, sorry, I mean the Workspace App, of course.
On the client side, Citrix uses the HdxBrowserCef.exe to render the pages locally.
This immediately raised some questions, what does CEF stand for?
After setting the necessary policies/reg keys to enable redirection, as shown below;
And installing the Chrome extension;
https://chrome.google.com/webstore/detail/browser-content-redirecti/hdppkjifljbdpckfajcmlblbchhledln
We were able to successfully run teams locally, and everything worked…
Except video calling.
No video calling using Chrome, no Browser redirection using Edge
It seems that browser video calling is not possible using Chrome, I donโt know why, because technically itโs not an issue, at all. I know that Microsoft Teams in-browser video conferencing on Edge works. Must be a political thing. Apparently, on the server side Microsoft checks what browser youโre using and only allows Edge browsers to do video conferencing. However, the issue remains, Edge does not support browser redirection.
After some tests, I found that Chrome could be fooled into presenting itself as if it was Edge by setting the User Agent to a Edge identifier. Using shift-control i, and select, network conditions, User agent;
Now if I could only fool the local browser in presenting itself with a Edge user agent. The local browser is in this case is the โHdxBrowserCef.exeโ, it comes with the Citrix Workspace App (Receiver).
Further inspection on the HdxBrowserCef.exe revealed that it uses the open source lib called Chromium Embedded Framework (CEF). It does not use the local Google Chrome. Now we know what CEF stands for in HdxBrowserCef.exe.
The question is, is it possible for CEF to change the user agent, and does CEF support webcam access?
Yes, it is, and here’s how!
and;
But to re-write the whole HdxBrowserCef.exe is a bridge too far, we only needed it to present itself as Edge.
I started searching for User Agent strings in the Citrix Workspace App folder that holds the HdxBrowserCef.exe. And found it in the โlibcef.dllโ. We dove into the file using a hex editor (https://hexed.it/), searched for โmozillaโ, because thatโs in all User Agent strings;
Changed this into;
Adding an Edge user string to the User Agent string. Saved the .dll, and tested this using www.whatismybrowser.com to see if we successfully fooled the HdxBrowserCef.exe into presenting itself as Edge. And it worked! Notice that strings are stored using &h00 as โend of stringโ, and &h20 as โspaceโ.
The next test was, will in-browser Teams video calling work?, the icon was there so it looked promising.
After a few video calls, I concluded this work-around works. Please keep in mind that using this setup every redirected web-page, including youtube, will be requested as Edge.
Dennis Smith – Gourami.eu
Disclaimer: this article is intended as a technical proof of concept. We do not recommend doing this yourself.