You are not alone with this problem. At time of writing this post, even the Google Analytics does not exclusively identify the Edge browser.
Your best bet is to refer to the user agent of the request, it will be something like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.9600
(To extract the user agent from the request in JavaScript see this post: Getting the User Agent with JavaScript)
Edge is only available in Windows 10 so you can use this knowledge to help ensure your logic is safe. Look for the following values in the UA:
Windows NT 10.0
- which tells you that the user is on Windows 10)
Edge
- which tells you that the user is on Edge
You could, of course, just look for Edge
too.
Update - 05/08
Google Analytics have now included Windows 10 and Edge as first class dimensions and these can both now be filtered directly.
browser=='ed'
for Edge - #21757605 – AnglicismMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36 Edg/80.0.361.109
. However, I don't think that an additional check for the missinge
is necessary, as Edge is now based upon Chromium and basically the same as Google Chrome from now on - effectively eliminating incompatibilities. – Vagary