Again, this article is concentrated on SharePoint Online, but is possible to work in SharePoint 2013 as well. So, in case you tested this, please let me know if is working or not. I assume will be a yes as I can recognize some of the feature from SharePoint 2007.

Detecting browser

As a SharePoint Developer, making use of web technologies, you might be requested to identify browser and develop separate code depending on what browser customer is using.

if (browseris.ie === true) {
    // IE implementation
};

if (browseris.firefox === true) {
    // Firefox implementation
};

if (browseris.chrome === true) {
    // Chrome implementation
};

Detecting browser version

Sometimes, detecting browser is not sufficient and as a developer you need to identify browser version. And again, some properties of “browseris” object can help you (values should be compare with Boolean value).

// Chrome
var chrome7up = browseris.chrome7up;
var chrome8up = browseris.chrome8up;
var chrome9up = browseris.chrome9up;

// Firefox
var firefox3up = browseris.firefox3up;
var firefox36up = browseris.firefox36up;
var firefox4up = browseris.firefox4up;

// IE
var ie7down = browseris.ie7down;
var ie8down = browseris.ie8down;
var ie9down = browseris.ie9down;
var ie7up = browseris.ie7up;

I have to admit IE logic is a little bit strange, but you can still get full Internet Explorer version using this code:

var ieversion  = browseris.verIEFull;

Unfortunately, it is returning undefined in IE11 with document mode set to edge, because code is actually do not identified browser as being Internet Explorer.

// For IE11, this is false
browseris.ie === false;
Advertisements