cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] js commit: Fix webOS SmartTV/wearable detection
Date Thu, 23 Jul 2015 00:06:22 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master e483adc8b -> e994460cf


Fix webOS SmartTV/wearable detection


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/e994460c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/e994460c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/e994460c

Branch: refs/heads/master
Commit: e994460cf5d0855db7cdac0b3e297dc3f67f880d
Parents: 98b23ad
Author: Jason Robitaille <jason.robitaille@lge.com>
Authored: Thu Jun 4 10:48:57 2015 -0700
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Wed Jul 22 17:03:01 2015 -0700

----------------------------------------------------------------------
 src/legacy-exec/webos/platform.js      | 2 +-
 src/legacy-exec/webos/webos/service.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/e994460c/src/legacy-exec/webos/platform.js
----------------------------------------------------------------------
diff --git a/src/legacy-exec/webos/platform.js b/src/legacy-exec/webos/platform.js
index 965a6ad..78c654a 100644
--- a/src/legacy-exec/webos/platform.js
+++ b/src/legacy-exec/webos/platform.js
@@ -23,7 +23,7 @@ module.exports = {
     id: 'webos',
     bootstrap: function() {
         var channel = require('cordova/channel');
-        var isLegacy = ((navigator.userAgent.indexOf("webOS")>-1) || (navigator.userAgent.indexOf("hpwOS")>-1));
+        var isLegacy = /(?:web|hpw)OS\/(\d+)/.test(navigator.userAgent);
         var webOSjsLib = (window.webOS!==undefined);
         if(!webOSjsLib && window.PalmSystem && window.PalmSystem.stageReady
&& isLegacy) {
             window.PalmSystem.stageReady();

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/e994460c/src/legacy-exec/webos/webos/service.js
----------------------------------------------------------------------
diff --git a/src/legacy-exec/webos/webos/service.js b/src/legacy-exec/webos/webos/service.js
index 0e4b111..315cb4a 100644
--- a/src/legacy-exec/webos/webos/service.js
+++ b/src/legacy-exec/webos/webos/service.js
@@ -19,7 +19,7 @@
  *
 */
 
-var isLegacy = ((navigator.userAgent.indexOf("webOS")>-1) || (navigator.userAgent.indexOf("hpwOS")>-1));
+var isLegacy = /(?:web|hpw)OS\/(\d+)/.test(navigator.userAgent);
 
 function LS2Request(uri, params) {
     this.uri = uri;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message