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

is.edge() returns false in edge (tested on windows and mac os) #313

Open
beccabrown opened this issue Jun 30, 2020 · 3 comments
Open

is.edge() returns false in edge (tested on windows and mac os) #313

beccabrown opened this issue Jun 30, 2020 · 3 comments

Comments

@beccabrown
Copy link

This is because the regex is:
var match = userAgent.match(/edge\/(\d+)/);
Whereas the user agent chosen by microsoft is edg. (see here https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-string).

My user agent on macos is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56

It is the same on windows too.

I propose changing the regex to: var match = userAgent.match(/edg\/(\d+)/);

@UmbyUmbreon
Copy link

This is because the newer versions of Edge are essentially Chromium now, and Microsoft changed the user agent to Edg to avoid inconsistencies with detecting the Spartan and Chromium user agents.

Given the reason why #214 was closed, I would wager that it would be acceptable that is.edge() returns false and is.chrome() returns true. I use is.ie() || is.edge() to detect cases where a user is using either IE or Edge Spartan, so if Edge Chromium were to be "fixed" I would personally prefer another function like is.edgeChromium() to detect newer versions of Edge instead.

@humayunkabir
Copy link

is.edgeChromium()

I think this is a good proposal.

@dearsina
Copy link

Any update on this? Would love to see edgeChromium.

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

4 participants