{ "id": "136051", "key": "TIMOB-17613", "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": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-09-15T17:37:10.000+0000", "created": "2014-09-03T15:57:15.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "3.3.0", "Android", "Titanium", "evalJS", "module_android", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "40896", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "122989", "key": "TIMOB-15896", "fields": { "summary": "WebView's evalJS method times out on Android API >= 17", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "40882", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "100659", "key": "TIMOB-10837", "fields": { "summary": "Android: webView throws on evalJS when string starts with `var`", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "40864", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "133366", "key": "AC-1157", "fields": { "summary": "WebView.evalJS times out / throws 'Unexpected token' error", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-11-20T15:50:52.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" } ], "attachment": [ { "id": "50952", "filename": "Screen Shot 2014-09-03 at 5.08.00 PM.png", "author": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-03T15:57:16.000+0000", "size": 236063, "mimeType": "image/png" } ], "flagged": false, "summary": "Unable to execute javascript code using evalJS on Android with SDK 3.3.0.GA", "creator": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "OSX 10.9.2\r\nTitanium SDK 3.3.0.GA\r\nGenymotion, Android 4.1.1 on Custom Tablet 10inch", "closedSprints": [ { "id": 199, "state": "closed", "name": "2014 Sprint 18 SDK", "startDate": "2014-09-02T22:56:57.421Z", "endDate": "2014-09-13T00:00:00.000Z", "completeDate": "2014-09-15T20:08:19.146Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "321810", "author": { "name": "Urban.Gerber@audatex.ch", "key": "urban.gerber@audatex.ch", "displayName": "Urban Gerber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We have this issue in our enterprise app, relying on evaluating js functions embedded in remote html pages rendered in a WebView. We use this as kind of event mechanism, for the app to take control on certain user actions done on the remote web site.\r\n\r\nI have tested Ivo's sample on a real device, Samsung Galaxy Note 10.1.\r\nWorks on SDK 3.2.3, does not work on SDK 3.3.0!\r\n\r\nThis is a blocking issue for us, cannot upgrade the SDK. \r\nPlease fix in the next SDK.\r\nThanks", "updateAuthor": { "name": "Urban.Gerber@audatex.ch", "key": "urban.gerber@audatex.ch", "displayName": "Urban Gerber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-04T13:37:12.000+0000", "updated": "2014-09-04T13:37:12.000+0000" }, { "id": "321812", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "From TIMOB-15896, is it possible for you to try adding the annotation and see if that fixes the issue for you? It would require you to build a custom SDK, but it would help speed up resolution.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-04T13:46:48.000+0000", "updated": "2014-09-04T13:46:48.000+0000" }, { "id": "322036", "author": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After doing some investigation on the changes done on this file \r\nhttps://github.com/appcelerator/titanium_mobile/blob/3_3_X/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebViewBinding.java#L153\r\nWe believe that we have located the problem, which according us is not related to missing annotation in the code (note that annotation is already present, and according to the Android documentation this has effect only on API >= 17).\r\nInstead, we think that the problem is introduced by newly added code, which does some pattern matching before evaluating the Javascript expression. The conslusion was made by comparing the same file from 3.2.X and 3.3.X (copy the contents of both files in some diff tool). \r\nAfter reverting this code, and building the Titanium SDK from scratch, it seems that the issue is resolved. However, we believe that this code was put there for some reason, thus removing it is not the best idea. \r\nWe would be very gratefull if you fix the problem with the pattern/matcher and provide the fix in the next SDK release. ", "updateAuthor": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-05T14:39:08.000+0000", "updated": "2014-09-05T14:41:46.000+0000" }, { "id": "322037", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you! That's very helpful.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-05T14:51:34.000+0000", "updated": "2014-09-05T14:51:34.000+0000" }, { "id": "322039", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The original test case (from TIMOB-10837):\r\n\r\n{code}\r\nwebView.addEventListener('load', function() {\r\n webView.evalJS('var a=\"test\";document.body.innerHTML=a'); // doesn't works\r\n //webView.evalJS('document.body.innerHTML=\"test\"'); // works\r\n});\r\n{code}\r\n\r\nSeems we need to add a few more cases to make sure we evaluate them correctly. I'm assuming we can simplify the example above. Is it just because it's a self-invoking function?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-05T14:57:20.000+0000", "updated": "2014-09-05T14:57:20.000+0000" }, { "id": "322088", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Marking as for 3.4.0 unless we come up with a suitable workaround.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-05T18:28:06.000+0000", "updated": "2014-09-05T18:28:06.000+0000" }, { "id": "322229", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/6026\r\n3.4.X PR: https://github.com/appcelerator/titanium_mobile/pull/6027", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-07T17:36:23.000+0000", "updated": "2014-09-07T17:43:03.000+0000" }, { "id": "323379", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nAfter running the code in the description we now get :\r\n{code}\r\n[INFO] : ALERT: (KrollRuntimeThread) [456,456] {f1:1,f2:2}}\r\n{code}\r\nwhich is expected behaviour & shows the execution of javascript code using evalJS.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 3.4.0.201409112242\r\nTi SDK : 3.4.0.v20140912084114 \r\nMac OSX : 10.9.4\r\nAlloy : 1.5.0-rc\r\nCLI - 3.4.0-rc2\r\nCode Processor: 1.1.1\r\nGenymotion Emulator - android 4.1.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-12T18:35:50.000+0000", "updated": "2014-09-12T18:35:50.000+0000" }, { "id": "333051", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "This happens again on 3.4.1GA on Lollipop.\r\nOn Android 4.4.2 it's all fine.", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-11-20T15:11:51.000+0000", "updated": "2014-11-20T15:11:51.000+0000" }, { "id": "333056", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Please ignore my previous comment. It was premature.", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-11-20T15:50:52.000+0000", "updated": "2014-11-20T15:50:52.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }