MCPcopy Create free account
hub / github.com/c3js/c3 / getIEVersion

Function getIEVersion

c3.js:143–158  ·  view source on GitHub ↗
(agent)

Source from the content-addressed store, hash-verified

141 * @param string agent Optional parameter to specify user agent
142 */
143 var getIEVersion = function (agent) {
144 // https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie
145 if (typeof agent === 'undefined') {
146 agent = window.navigator.userAgent;
147 }
148 var pos = agent.indexOf('MSIE '); // up to IE10
149 if (pos > 0) {
150 return parseInt(agent.substring(pos + 5, agent.indexOf('.', pos)), 10);
151 }
152 pos = agent.indexOf('Trident/'); // IE11
153 if (pos > 0) {
154 pos = agent.indexOf('rv:');
155 return parseInt(agent.substring(pos + 3, agent.indexOf('.', pos)), 10);
156 }
157 return false;
158 };
159 /**
160 * Returns whether the used browser is Internet Explorer.
161 *

Callers 1

isIEFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…