question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft Edge Chromium based being detected as Chrome

See original GitHub issue

The Microsoft Edge version that is based on Chromium is being detected as Google Chrome. The browser includes a specific string to identify itself.

Here’s a sample user agent strings and how they differ:

Microsoft Edge Chromium based:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3782.0 Safari/537.36 Edg/76.0.152.0

Microsoft Edge Classic

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763

As we can see the new Edge is using just Edg instead of Edge to identify itself.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
dilijevcommented, Feb 5, 2020

Edge Legacy (EdgeHTML) uses Edge/ in its user agent as @Martii indicated in the first example.

The User-Agent for Stable release of Chromium-based Edge is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 Edg/79.0.309.71

The User-Agent for Edge iOS uses EdgiOS/ as @vmjames indicated.

The User-Agent for Edge Android uses EdgA/ for example: Mozilla/5.0 (Linux; Android 10; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.0 Mobile Safari/537.36 EdgA/44.11.4.4140

0reactions
luislobo14rapcommented, Apr 13, 2022
// is-edge.js v1
function isEdge(versionName, userAgent) {
	versionName = versionName ? versionName.toLowerCase() : 'desktop';
	userAgent = userAgent ? userAgent : navigator.userAgent;
	switch (versionName) {
		case 'desktop':
			return (/Edge?\//).test(userAgent);
		case 'chromium':
			return (/Edg\//).test(userAgent);
		case 'legacy':
			return (/Edge\//).test(userAgent);
		case 'mobile':
			return (/Edg(A|iOS)\//).test(userAgent);
		case 'android':
			return (/EdgA\//).test(userAgent);
		case 'ios':
			return (/EdgiOS\//).test(userAgent);
	};
};

Example of use:

if( isEdge('legacy') ){
    // old
};
if( isEdge('chromium') ){
    // new
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Will Edge always identify as Chrome?
I was just wondering if Edge, because it is now based on Chromium, ... not recognize the "Edg" UAID, then the website reverts...
Read more >
How to detect Microsoft Chromium Edge (chredge , edgium) in ...
You could use the window.navigator userAgent to check whether the browser is Microsoft Chromium Edge or Chrome. Code as below:
Read more >
An introduction to Edge Chromium vs. Edge - TechTarget
Edge Chromium also moves away from Edge Legacy to adopt similar Settings found in Chrome. Clicking the three-dot icon in the upper right ......
Read more >
Chromium Edge: What It Is and How to Get It - Lifewire
Microsoft Edge was launched alongside Windows 10 as a replacement for the venerable Internet Explorer web browser. It was originally built ...
Read more >
How is Microsoft's Chromium-based Edge really different from ...
Microsoft is removing or replacing more than 50 Chromium services in building its new Chromium-based Edge browser, besides working to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found