{ "id": "64186", "key": "TIMOB-3554", "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": "11357", "description": "Mobile 1.8.0 M04", "name": "Sprint 2011-25", "archived": true, "released": true, "releaseDate": "2011-06-27" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-07-07T11:12:08.000+0000", "created": "2011-04-15T03:46:35.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-02-15T10:14:17.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": "A number of users in the Q&A have reported that evalJS applied to a webview causes an exception. The following usecase demonstrates the problem, which results in [this trace|http://pastebin.com/raw.php?i=HNGHQn6C]\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"blue\",\r\n\texitOnClose:true\r\n});\r\n\r\nvar myWeb = Ti.UI.createWebView({\r\n\turl:'myweb.htm',\r\n\t// url:'http://www.mydomain.net/myweb.htm',\r\n\turl:'myweb.htm',\r\n\tbackgroundColor:'green'\r\n});\r\n\r\nmyWeb.addEventListener('load',function(e){\r\n\tvar title = myWeb.evalJS(\"return document.title;\");\r\n\tTi.API.info(\"The title of the webview is \" + title);\r\n});\r\n\r\nwin.add(myWeb);\r\n\r\nwin.open();\r\n{code}\r\n\r\n{code:title=myapp.htm}\r\n\r\n\r\n
\r\n\r\n\r\n\t\tThis is a Titanium test.\r\n\t
\r\n\tMoving contents of ticket #3510, by user KT, here:
\nHere's a test that will crash on Android 2.2 / Ti 1.7.X with\nSIGSEGV:
\n\nvar win = Ti.UI.createWindow({\n // Android\n navBarHidden: false,\n exitOnClose: true\n});\nvar view = Ti.UI.createWebView({\n scalesPageToFit: false,\n url: 'something.html'\n});\nview.addEventListener('load', function() {\n view.evalJS(\"test\");\n});\nwin.add(view);\nwin.open();
\n
\nThis code gives a crash dump similar to http://pastie.org/1754641
\nJust as some further background, and to help try to pinpoint it\nregression-wise, users seem to be having similar issues for at\nleast a year:
\nThis is, strangely, in direct contravention to the \ndrillbit test
\nIf that works, then what is drillbit doing differently so that\nit works whereas the app.js above crashes immediately?
\nThis crash doesn't seem to happen on 3.0. But the necessary Ti\nJavascript seems to never get injected, as is the case with 1.6\n(i.e., no crash, but no Ti injection). The injection problem is\ndescribed separately in #3539
This is the content
\r\n\t