Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Edge Chromium based being detected as Chrome #143

Open
chbomtempo opened this issue May 15, 2019 · 5 comments
Open

Microsoft Edge Chromium based being detected as Chrome #143

chbomtempo opened this issue May 15, 2019 · 5 comments

Comments

@chbomtempo
Copy link

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.

@Martii
Copy link

Martii commented Sep 4, 2019

@chbomtempo

I think that's on the beta channel releases. Main Win10 Pro 1903.18.362.239 is still fully spelled out.

Release:

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

Beta channel:

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

@vmjames
Copy link

vmjames commented Jan 22, 2020

Also on iPhone it is coming through as Mobile Safari
Agent {
family: 'Mobile Safari',
major: '13',
minor: '0',
patch: '0',
source:
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 EdgiOS/44.11.15 Mobile/15E148 Safari/605.1.15' }

@dilijev
Copy link

dilijev commented 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

@nadavb-codefuel
Copy link

Is there any update to that? I don't see the code having a reference to edge chromium!.

@luislobo14rap
Copy link

luislobo14rap commented 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
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants