Skip to content

Commit

Permalink
Fixed platform checks
Browse files Browse the repository at this point in the history
Using `navigator.platform` instead of `navigator.appVersion`
  • Loading branch information
ironmaniiith committed May 24, 2018
1 parent bf6534e commit 5629495
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions is.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@

// store navigator properties to use later
var navigator = freeSelf && freeSelf.navigator;
var appVersion = (navigator && navigator.appVersion || '').toLowerCase();
var platform = (navigator && navigator.platform || '').toLowerCase();
var userAgent = (navigator && navigator.userAgent || '').toLowerCase();
var vendor = (navigator && navigator.vendor || '').toLowerCase();

Expand Down Expand Up @@ -704,14 +704,14 @@

// is current operating system linux?
is.linux = function() {
return /linux/.test(appVersion);
return /linux/.test(platform) && is.not.android();
};
// linux method does not support 'all' and 'any' interfaces
is.linux.api = ['not'];

// is current operating system mac?
is.mac = function() {
return /mac/.test(appVersion);
return /mac/.test(platform);
};
// mac method does not support 'all' and 'any' interfaces
is.mac.api = ['not'];
Expand Down Expand Up @@ -788,7 +788,7 @@

// is current operating system windows?
is.windows = function() {
return /win/.test(appVersion);
return /win/.test(platform);
};
// windows method does not support 'all' and 'any' interfaces
is.windows.api = ['not'];
Expand Down

0 comments on commit 5629495

Please sign in to comment.