(agent)
| 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 | * |
no outgoing calls
no test coverage detected
searching dependent graphs…