Showing results for 
Search instead for 
Did you mean: 
Adventurer II

Detecting the Edge Browser

So we have a browser check page (UAB Canvas Setup Guide) that we encourage our students and off campus faculty to use that will let them know if they have an appropriate browser for using Canvas. We do this primarily for our new students that do not have access to our Canvas system yet so that they can begin preparing before their first classes. However I am having issues with checking for the Edge browsers since they do not not seem to keep the user facing numbering and agent number consistent with each other. I was wondering if anyone might be able to clarify how Canvas is checking for this or if there is an easier way. I am including the .js file I am using. Please note that this is a modified version from a Blackboard administrator  so there is more that it is checking for than I "need" but it is nice to display this information as well.

Tags (2)
3 Replies

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

I concur, however, my experience with Edge in Canvas has only demonstrated issues when working with LTIs. My use of it is also greatly limited by it only being available from my home system.

Though I don't condone the supporting of any browser created by Microsoft (thus far), if you intend to support it the variation I posted to  @mjennings ​ posted script should be adequate for the version of Edge currently available.