Recognizing Edge Windows

Yesterday, we had a customer reach out to us for help on an issue they’d encountered while writing code to interact with Microsoft Edge windows. Their script enumerated every window in the system, looking for those with Microsoft Edge in the titlebar. They were surprised to discover that the script didn’t recognize any of theirContinue reading “Recognizing Edge Windows”


This content originally appeared on text/plain and was authored by ericlaw

Yesterday, we had a customer reach out to us for help on an issue they’d encountered while writing code to interact with Microsoft Edge windows. Their script enumerated every window in the system, looking for those with Microsoft Edge in the titlebar. They were surprised to discover that the script didn’t recognize any of their browser windows, despite the fact that they could plainly see the product’s name in several windows on the taskbar and ALT+Tab overlay.

Weird, right?

After investigating further, the customer realized that the Edge window titles contained a Zero Width Space (+200B) Unicode character immediately after the word Microsoft and before the regular space character preceding the word Edge.

What possible use could that have?” the customer wondered.

When I started looking into this, I assumed it was simply a mistake, whereby someone had accidentally copied the invisible space into the IDS_BROWSER_WINDOW_TITLE_FORMAT resource within Edge’s version of Chromium. After all, if regular whitespace is a menace, invisible whitespace is at least doubly-so.

However, when I saw the source code, I realized that the developer definitely put it there on purpose:

<message name="IDS_BROWSER_WINDOW_TITLE_FORMAT">
<ph name="PAGE_TITLE">$1<ex>Title</ex></ph> - Microsoft Edge        
</message>

As you can see, the zero-width space is fully visible, HTML-encoded as the constant value &#8203. So, what’s up with that?

Investigation revealed that this character was added precisely to cause existing 3rd-party software not to recognize Microsoft Edge windows. It turns out that there’s a very popular touchpad driver that applies special scrolling behavior for the (now defunct) Microsoft Edge Legacy (Spartan) browser, and this code doesn’t behave properly in the new Chromium-based Microsoft Edge. The touchpad’s software wasn’t doing any additional validation of the window’s owning process executable name or similar to limit its scope. So, the only straightforward way to prevent it from breaking Edge was to apply this trick. We filed a bug to eventually remove the character after the touchpad’s code is fixed.

If you’re writing an AutoHotkey script or other code to try to interact with Edge’s windows based on their window title, you’ll need to account for this invisible space.

-Eric


This content originally appeared on text/plain and was authored by ericlaw


Print Share Comment Cite Upload Translate Updates
APA

ericlaw | Sciencx (2022-01-14T15:24:37+00:00) Recognizing Edge Windows. Retrieved from https://www.scien.cx/2022/01/14/recognizing-edge-windows/

MLA
" » Recognizing Edge Windows." ericlaw | Sciencx - Friday January 14, 2022, https://www.scien.cx/2022/01/14/recognizing-edge-windows/
HARVARD
ericlaw | Sciencx Friday January 14, 2022 » Recognizing Edge Windows., viewed ,<https://www.scien.cx/2022/01/14/recognizing-edge-windows/>
VANCOUVER
ericlaw | Sciencx - » Recognizing Edge Windows. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/14/recognizing-edge-windows/
CHICAGO
" » Recognizing Edge Windows." ericlaw | Sciencx - Accessed . https://www.scien.cx/2022/01/14/recognizing-edge-windows/
IEEE
" » Recognizing Edge Windows." ericlaw | Sciencx [Online]. Available: https://www.scien.cx/2022/01/14/recognizing-edge-windows/. [Accessed: ]
rf:citation
» Recognizing Edge Windows | ericlaw | Sciencx | https://www.scien.cx/2022/01/14/recognizing-edge-windows/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.