Sitelet https://github.com/faisalman/ua-parser-js/issues/279
Skip to content

Breaking fix - Edge browser.major should be Edge version, not EdgeHTML version #279

Description

@mikemaccana

Currently parsedUserAgent.browser.major is incorrect for Edge - it reports parsedUserAgent.engine.major instead. I.E. Edge 41 incorrectly reports a parsedUserAgent.browser.major of 16 - this is the EdgeHTML version but not the browser version.

I'm currently working around this with something like:

var EDGEHTML_VS_EDGE_VERSIONS = {
	12: 0.1,
	13: 21,
	14: 31,
	15: 39,
	16: 41
}; 

var browserMajorVersion = parsedUserAgent.browser.major;
if ( browserName === 'Edge' ) {
	browserMajorVersion = EDGEHTML_VS_EDGE_VERSIONS[browserMajorVersion]
}

It would be cool if UA Parser JS did something similar. It's a breaking change though so should be in a major new version.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions