CB-7896 Better way to detect Windows and WidnowsPhone81
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/5e4ce8a4 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/5e4ce8a4 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/5e4ce8a4 Branch: refs/heads/master Commit: 5e4ce8a48f39ef9c7ec74ed5e5f0909efff794e7 Parents: 684a451 Author: sgrebnov <[email protected]> Authored: Mon Nov 24 09:36:37 2014 +0300 Committer: sgrebnov <[email protected]> Committed: Mon Nov 24 09:36:37 2014 +0300 ---------------------------------------------------------------------- tests/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/5e4ce8a4/tests/tests.js ---------------------------------------------------------------------- diff --git a/tests/tests.js b/tests/tests.js index 90fdee1..be0ac32 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -25,8 +25,8 @@ exports.defineAutoTests = function () { var gContactObj = null, gContactId = null, isWindowsPhone8 = cordova.platformId == 'windowsphone', - isWindows = (cordova.platformId === "windows") || (navigator.appVersion.indexOf("MSAppHost/1.0") !== -1), - isWindowsPhone81 = (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1); + isWindows = (cordova.platformId === "windows") || (cordova.platformId === "windows8"), + isWindowsPhone81 = isWindows && WinJS.Utilities.isPhone; var fail = function(done) { expect(true).toBe(false); done(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
