{ "id": "123904", "key": "TIMOB-16082", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-08-18T15:51:21.000+0000", "created": "2013-12-17T22:24:01.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Android", "WebView", "evalJs", "exalture", "kitkat" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-18T15:51:21.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "WebView.evalJS appears to always return null on devices running Android Kit-Kat, regardless of the provided script. \r\n\r\nExample app:\r\n{code:title=app.js|language=javascript}\r\n\r\nvar win = Titanium.UI.createWindow({ \r\n title:'EvalJS kit-kat test',\r\n backgroundColor:'#fff'\r\n});\r\nvar webView = Ti.UI.createWebView({\r\n url : 'http://www.google.com'\r\n});\r\nwebView.addEventListener('load', function(evt){\r\n //Expected behavior is for an alert saying 'google' to be shown\r\n //On Android Kit-Kat, an empty alert is shown instead.\r\n alert(evt.source.evalJS('document.title'));\r\n});\r\n\r\nwin.add(webView);\r\nwin.open();\r\n{code}\r\n\r\nReproduces on 3.1.3.GA and 3.2.0.v20131210191510", "attachment": [], "flagged": false, "summary": "Android: WebView.evalJS always returns null on Android 4.2.2 device", "creator": { "name": "shockoe", "key": "shockoe", "displayName": "SHOCKOE TEAM", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "shockoe", "key": "shockoe", "displayName": "SHOCKOE TEAM", "active": true, "timeZone": "America/New_York" }, "environment": "Tested on Nexus 5 (Android 4.4.2) and Nexus 7 (Android 4.4.2)", "closedSprints": [ { "id": 796, "state": "closed", "name": "2017 Sprint 02 SDK", "startDate": "2017-01-15T00:00:41.845Z", "endDate": "2017-01-29T00:00:00.000Z", "completeDate": "2017-01-30T21:10:44.640Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "285134", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have not been able to reproduce this problem on Nexus 7 phone running Android 4.4 with 3.1.3 SDK. \n\nI am wondering if you encounter this issue only on Android 4.4 device or can you reproduce this issue on other devices as well? Can you reproduce this issue on the simulator too? I would appreciate if you can also try an alternate website in the above example. ", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-19T05:09:45.000+0000", "updated": "2013-12-19T05:09:45.000+0000" }, { "id": "285719", "author": { "name": "ptquang86", "key": "ptquang86", "displayName": "Quang Pham", "active": true, "timeZone": "Asia/Jakarta" }, "body": "same here, evalJS always return null for 3.2 SDK, Android 4.0", "updateAuthor": { "name": "ptquang86", "key": "ptquang86", "displayName": "Quang Pham", "active": true, "timeZone": "Asia/Jakarta" }, "created": "2013-12-24T07:34:47.000+0000", "updated": "2013-12-24T07:34:47.000+0000" }, { "id": "285863", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce it on Samsung Galaxy Nexus (4.2.2) device.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-26T16:47:30.000+0000", "updated": "2013-12-26T16:47:30.000+0000" }, { "id": "285922", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi All--Since this was reproduced on 4.2.2, should we rewrite the ticket to not be KitKat specific?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-27T01:37:17.000+0000", "updated": "2013-12-27T01:37:17.000+0000" }, { "id": "288308", "author": { "name": "adampax", "key": "adampax", "displayName": "Adam Paxton", "active": true, "timeZone": "America/New_York" }, "body": "Same issue on Galaxy Nexus running 4.3. Build with Ti SDK 3.2.0.GA", "updateAuthor": { "name": "adampax", "key": "adampax", "displayName": "Adam Paxton", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-15T18:58:41.000+0000", "updated": "2014-01-15T18:58:41.000+0000" }, { "id": "296292", "author": { "name": "meltaweel", "key": "meltaweel", "displayName": "Muhammad Mahmoud", "active": true, "timeZone": "Africa/Cairo" }, "body": "Reproduced on Samsung Galaxy S4 running 4.3 and Nexus 4 running 4.4 with Ti SDK 3.1.2.GA", "updateAuthor": { "name": "meltaweel", "key": "meltaweel", "displayName": "Muhammad Mahmoud", "active": true, "timeZone": "Africa/Cairo" }, "created": "2014-03-10T12:47:21.000+0000", "updated": "2014-03-10T12:47:21.000+0000" }, { "id": "308864", "author": { "name": "MichielD", "key": "michield", "displayName": "Michiel Dondorp", "active": true, "timeZone": "Europe/Berlin" }, "body": "I think the problem originates in this:\r\nhttp://developer.android.com/guide/webapps/migrating.html\r\n\r\n??Android 4.4 (API level 19) introduces a new version of WebView that is based on Chromium. This change upgrades WebView performance and standards support for HTML5, CSS3, and JavaScript to match the latest web browsers. Any apps using WebView will inherit these upgrades when running on Android 4.4 and higher.??", "updateAuthor": { "name": "MichielD", "key": "michield", "displayName": "Michiel Dondorp", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-06-13T08:58:27.000+0000", "updated": "2014-06-13T08:58:27.000+0000" }, { "id": "316871", "author": { "name": "AGPX", "key": "agpx", "displayName": "Gianluca Arcidiacono", "active": true, "timeZone": "Europe/Rome" }, "body": "Same problem with Nexus 5 (Android 4.4.4, SDK 3.3.0). Any workaround?", "updateAuthor": { "name": "AGPX", "key": "agpx", "displayName": "Gianluca Arcidiacono", "active": true, "timeZone": "Europe/Rome" }, "created": "2014-08-04T17:17:53.000+0000", "updated": "2014-08-04T17:18:22.000+0000" }, { "id": "316883", "author": { "name": "MichielD", "key": "michield", "displayName": "Michiel Dondorp", "active": true, "timeZone": "Europe/Berlin" }, "body": "I no longer have this when I just do:\r\n{code:js}\r\nvar command;\r\nif(android){\r\n command = \"return \" + command;\r\n}\r\nevalJs(command);\r\n{code}\r\n\r\nJust found the code again which handles this:\r\n[ti.ui.widget.webview.TiWebViewBinding.java|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebViewBinding.java]\r\nLine 147: getJsValue", "updateAuthor": { "name": "MichielD", "key": "michield", "displayName": "Michiel Dondorp", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-08-04T17:57:07.000+0000", "updated": "2014-08-04T17:57:07.000+0000" }, { "id": "347425", "author": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "body": "confirmed\r\n\r\nreturn is needed on Android (tested on Nexus 5, Android 5.0.1) but cause return null on iOS\r\n\r\nwtf", "updateAuthor": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-03-26T10:45:46.000+0000", "updated": "2015-03-26T10:45:46.000+0000" }, { "id": "353598", "author": { "name": "shockoe", "key": "shockoe", "displayName": "SHOCKOE TEAM", "active": true, "timeZone": "America/New_York" }, "body": "Any updates on this ticket?", "updateAuthor": { "name": "shockoe", "key": "shockoe", "displayName": "SHOCKOE TEAM", "active": true, "timeZone": "America/New_York" }, "created": "2015-05-27T02:53:53.000+0000", "updated": "2015-05-27T02:53:53.000+0000" }, { "id": "405619", "author": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Could not reproduce. Tried with 4.2.X-4.4.X, 6 and 7.X emulators. Alert dialogue returned expected non-null values.", "updateAuthor": { "name": "fmerzadyan", "key": "fmerzadyan2", "displayName": "Frankie Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-01-30T18:45:49.000+0000", "updated": "2017-01-30T18:45:49.000+0000" }, { "id": "426902", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Since this issue is not reproducible I'm going to close this as invalid.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-18T15:51:21.000+0000", "updated": "2017-08-18T15:51:21.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }