Average time to read: 4 minutes

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;

https://www.citrix.com/blogs/2018/12/12/browser-content-redirection-2-0-will-help-you-maximize-your-multimedia/

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!

https://stackoverflow.com/questions/22655366/how-to-change-user-agent-in-chromium-embedded-framework-in-c

and;

(source https://ourcodeworld.com/articles/read/425/how-to-enable-webrtc-access-camera-and-microphone-for-cefsharp-in-winforms)

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.

Bas van Kaam on FacebookBas van Kaam on LinkedinBas van Kaam on Twitter
Bas van Kaam
Bas van Kaam
Field CTO EMEA by day, author by night @ Nerdio
Father of three, EMEA Field CTO @ Nerdio, Author of the book Van de Basis tot aan Meester in de Cloud, Co-author of the book Project Byte-Sized and Yuthor of the book: Inside Citrix โ€“ The FlexCast Management Architecture, over 500 blog posts and multiple (ultimate) cheat sheets/e-books. Public speaker, sport enthusiastยญยญยญยญยญยญยญยญ: above-average runner, 3 x burpee-mile finisher and a former semiprofessional snooker player. IT community participant and initiator of the AVD User group Community world wide.
, , , ,


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

About

Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown prmontserrat took a galley of type and scrambled it to make a type specimen book.

Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown prmontserrat took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Categories

Gallery

Verified by MonsterInsights