Files
jasmine/spec/javascripts/helpers/BrowserFlags.js
Gregg Van Hove and Rajan Agaskar 5017d1a4f1 Make rake jasmine:ci run specs correctly.
- Will replace rake core_specs.
- Remove obsolete dependencies & files -- most of these were for build tasks we
  are no longer using. Notably, rspec and spec_helper were deleted.
2013-09-25 10:11:02 -07:00

24 lines
652 B
JavaScript

(function(env) {
function browserVersion(matchFn) {
var userAgent = jasmine.getGlobal().navigator.userAgent;
if (!userAgent) { return void 0; }
var match = matchFn(userAgent);
return match ? parseFloat(match[1]) : void 0;
}
env.ieVersion = browserVersion(function(userAgent) {
return /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
});
env.safariVersion = browserVersion(function(userAgent) {
return /Safari/.exec(userAgent) && /Version\/([0-9]{0,})/.exec(userAgent);
});
env.firefoxVersion = browserVersion(function(userAgent) {
return /Firefox\/([0-9]{0,})/.exec(userAgent);
});
})(jasmine.getEnv());