{ "id": "78734", "key": "TIMOB-4885", "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": "12077", "description": "", "name": "Sprint 2011-37", "archived": true, "released": true, "releaseDate": "2011-09-19" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-09-27T09:55:53.000+0000", "created": "2011-08-03T14:51:11.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_webview", "qe-testadded" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2014-06-19T12:46: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": "Evaluating a javascript function inside an html results in a crash. works fine on iOS\r\nStep1: copy the below code to app.js\r\n{code}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#cccccc' });\r\n\t \r\nvar webView = Ti.UI.createWebView({ width: 300, height: 200, top: 0, left: 0,backgroundColor: 'white', \r\nurl:'test.html'\r\n}); \t\r\nwin.add(webView);\r\n\r\nwebView.addEventListener('load', function(){\r\n\t\r\n\tTi.API.debug('webivew loaded');\r\n//\t var title = webView.evalJS(\"document.title\"); // this works fine!\r\n//\tTi.API.debug(title);\r\n\tvar foo_return = webView.evalJS(\"foo('Hi')\"); \r\n\tTi.API.debug(foo_return);\r\n\r\n\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nStep2: Copy the below code to 'test.html' under the resources.\r\n{code}\r\n\r\n\r\n\t\r\n\t\tTest Webview Page\r\n\t\t\r\n\r\n\t

My hovercraft is full of eels.

\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nStep3: Crash log from ddms is attached.\r\n", "attachment": [ { "id": "22214", "filename": "crash_log.txt", "author": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T14:51:11.000+0000", "size": 12769, "mimeType": "text/plain" }, { "id": "22925", "filename": "timob4885.zip", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-09-13T15:58:09.000+0000", "size": 7563598, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: evalJS for javascript functions in webview results in a crash", "creator": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "anagesh", "key": "anagesh", "displayName": "Anirudh Nagesh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 1.7.2 and Android 2.2 and higher", "comment": { "comments": [ { "id": "163679", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Still working on it, but a quick note: I can only re-create this if the function being called has an {{alert()}}, {{prompt()}} or {{confirm()}} call in it. If anybody can re-create with a JS function (in the html file) that does not use one of these functions that pops up a dialog, please post another example failcase.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-08-22T15:09:28.000+0000", "updated": "2011-08-22T15:24:37.000+0000" }, { "id": "165920", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "See attached test app timob4885.zip for easy testing of evalJS that causes a UI to appear from within webview (alert()) and evalJS that does not cause a UI to appear from within webview.\r\n\r\nThe original problem was with using evalJS to show an alert. That should be fixed now. This test app incorporates the original fail case.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-09-13T15:58:09.000+0000", "updated": "2011-09-13T15:59:04.000+0000" }, { "id": "167095", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Merge.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-27T09:55:53.000+0000", "updated": "2011-09-27T09:55:53.000+0000" }, { "id": "173820", "author": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fix verified in SDK 1.8.0.1.v20111122105459 with a Nexus One running 2.2.2.", "updateAuthor": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-22T16:07:36.000+0000", "updated": "2011-11-22T16:07:36.000+0000" }, { "id": "281115", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR link:\nhttps://github.com/appcelerator/titanium_mobile/pull/5020", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-25T08:50:02.000+0000", "updated": "2013-11-25T08:50:02.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }