You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/11/12 17:06:47 UTC

[GitHub] brodybits closed pull request #535: Fix user agent match issue android pie

brodybits closed pull request #535: Fix user agent match issue android pie
URL: https://github.com/apache/cordova-android/pull/535
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bin/templates/project/assets/www/cordova.js b/bin/templates/project/assets/www/cordova.js
index 3ae354cd8..aa5c6f8f8 100644
--- a/bin/templates/project/assets/www/cordova.js
+++ b/bin/templates/project/assets/www/cordova.js
@@ -977,7 +977,7 @@ androidExec.init = function() {
     //using the Online Event bridge for communicating from Native to JS
     //
     //It's ugly, but it's necessary.
-    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
+    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9]+(\.[0-9]?)?/);
     var version_code = check && check[0].match(/4.[0-3].*/);
     if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
       nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
@@ -2183,4 +2183,4 @@ window.cordova = require('cordova');
 
 require('cordova/init');
 
-})();
\ No newline at end of file
+})();
diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js
index f73d87a12..639144530 100644
--- a/cordova-js-src/exec.js
+++ b/cordova-js-src/exec.js
@@ -114,7 +114,7 @@ androidExec.init = function() {
     //using the Online Event bridge for communicating from Native to JS
     //
     //It's ugly, but it's necessary.
-    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
+    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9]+(\.[0-9]?)?/);
     var version_code = check && check[0].match(/4.[0-3].*/);
     if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
       nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
diff --git a/test/app/src/main/assets/www/cordova.js b/test/app/src/main/assets/www/cordova.js
index 11da9eb0e..75781fd8a 100644
--- a/test/app/src/main/assets/www/cordova.js
+++ b/test/app/src/main/assets/www/cordova.js
@@ -982,7 +982,7 @@ androidExec.init = function() {
     //using the Online Event bridge for communicating from Native to JS
     //
     //It's ugly, but it's necessary.
-    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
+    var check = navigator.userAgent.toLowerCase().match(/android\s[0-9]+(\.[0-9]?)?/);
     var version_code = check && check[0].match(/4.[0-3].*/);
     if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
       nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
@@ -2203,4 +2203,4 @@ window.cordova = require('cordova');
 
 require('cordova/init');
 
-})();
\ No newline at end of file
+})();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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