Microsoft Edge is an oddity. Unlike other browsers, like Chrome and Firefox, the version of "Edge" found in the window.navigator.userAgent cannot be associated with the version of the browser, at least not directly. It represents EdgeHTML.
Currently, there are 3 versions out there: 12, 13, and 14. Version 12 was the initial release and corresponds to version 20 of the browser. Version 13 is the current release and it corresponds to version 25 of the browser. Lastly, version 14 is a future release that corresponds to version 38 of the browser.
My recommendation would be to base your compatibility off the EdgeHTML version. The actual browser version, at least as far as I've been able to find, is not accessible through JavaScript.
Basically, keep the current code, just change the edgeMin and edgeMax to reflect the EdgeHTML versions supported and modify the last final for the "case browserUserAgent.indexOf('edge') >= 0" to not add that 8:
| browserVersion = Number(browserVersion); // End user facing version is 20, when agent reports 12; 25 when reports 12; 38 when reports 14 |
|