{ "id": "61606", "key": "TIMOB-974", "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": "12093", "description": "", "name": "Sprint 2012-01", "archived": true, "released": true, "releaseDate": "2012-01-15" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "15821", "description": "2014 Sprint 02", "name": "2014 Sprint 02", "archived": true, "released": true, "releaseDate": "2014-01-31" }, { "id": "15823", "description": "2014 Sprint 02 API", "name": "2014 Sprint 02 API", "archived": true, "released": true, "releaseDate": "2014-01-31" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-02-06T18:19:02.000+0000", "created": "2011-04-15T02:40:35.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "defect", "module_webview", "parity", "qe-3.2.1", "qe-testadded", "regression" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [ { "id": "14461", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "84519", "key": "TIMOB-7014", "fields": { "summary": "NBC, WebView - html property is not readable", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "34903", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "125010", "key": "TIMOB-16249", "fields": { "summary": "Android: Web view evalJS is not working on Android versions >= JELLY_BEAN_MR1", "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": "Medium", "id": "3" }, "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-02-06T18:19:50.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": "h1. Problem\r\nThe html property of a web view returns undefined for remote URLs.\r\n\r\nh2. Sample Code\r\nThe following will test if the html property is convincingly set for a reliable remote URL (the server always returns the text \"GET\"). If it is, a green border will show up. If it fails, a red border will show up.\r\n{code:title=app.js}\r\n/**\r\n * This tests sees if the Ti.UI.WebView will properly return the HTML of a remote website.\r\n * (And it gets ornery if it fails to grab the HTML.)\r\n */\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\nvar web = Ti.UI.createWebView({\r\n url: 'http://appc.me/test/Echo',\r\n width: '90%', height: '90%', top: '5%', left: '5%'\r\n});\r\nwin.add(web);\r\nwin.open();\r\nweb.addEventListener('load', function() {\r\n // The server returns just 'GET', but iOS forces the web view to be well formed...\r\n Ti.API.info(web.html);\r\n // So we'll accept either a well formed HTML or the literal response from the server.\r\n if (web.html == 'GET' || web.html == 'GET') {\r\n win.backgroundColor = '#0f0';\r\n alert('PASS: I love you forever!');\r\n }\r\n // Otherwise... FAIL!\r\n else {\r\n win.backgroundColor = '#f00';\r\n alert('FAIL: web.html != expected html');\r\n }\r\n});\r\n{code}\r\n\r\nh2. Associated Helpdesk Ticket\r\nNone, but there is a Staff Augmentation project that needs this for their Android app to work.", "attachment": [], "flagged": false, "summary": "Android: Webview.html returns null if webview is based on URL", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK version: 1.7.0 (05/26/11 19:05 70a26b8...)\r\nWORKS on iPhone Simulator 4.3\r\nBROKEN on Android Samsung Epic 4G 2.2", "comment": { "comments": [ { "id": "134683", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "h2. Workaround\nYou can get around this issue in Android by grabbing the HTML yourself with some JavaScript. So, the above sample code becomes...\n{code:title=app.js}\n/**\n * This tests sees if the Ti.UI.WebView will properly return the HTML of a remote website.\n * (And it gets ornery if it fails to grab the HTML.)\n */\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\nvar web = Ti.UI.createWebView({\n url: 'http://appc.me/test/Echo',\n width: '90%', height: '90%', top: '5%', left: '5%'\n});\nwin.add(web);\nwin.open();\nweb.addEventListener('load', function() {\n // The server returns just 'GET', but iOS forces the web view to be well formed...\n var html = web.html || web.evalJS(\"''+document.getElementsByTagName('html')[0].innerHTML+''\");\n Ti.API.info(html);\n // So we'll accept either a well formed HTML or the literal response from the server.\n if (html == 'GET' || web.html == 'GET') {\n win.backgroundColor = '#0f0';\n alert('PASS: I love you forever!');\n }\n // Otherwise... FAIL!\n else {\n win.backgroundColor = '#f00';\n alert('FAIL: web.html != expected html');\n }\n});\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-06-01T15:58:23.000+0000", "updated": "2011-06-01T15:58:23.000+0000" }, { "id": "178995", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 1.9.0.v20120111103135\r\nRuntime: V8, Rhino\r\nTitanium Studio, build: 1.0.8.201201101928\r\nDevice: Droid 3 (2.3.4)\r\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-11T16:36:57.000+0000", "updated": "2012-01-11T16:36:57.000+0000" }, { "id": "179053", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Updating tags", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-12T10:05:53.000+0000", "updated": "2012-01-12T10:05:53.000+0000" }, { "id": "180224", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Updating tags", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-23T12:44:26.000+0000", "updated": "2012-01-23T12:44:26.000+0000" }, { "id": "281111", "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:48:20.000+0000", "updated": "2013-11-25T08:48:20.000+0000" }, { "id": "281766", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I am able to reproduce this issue.\r\nThis is regression, works fine on SDK: 3.1.3.GA\r\n\r\nUsing Environment:\r\nDevice : Google Nexus 7, Android Version: 4.2.1\r\nSDK: 3.2.0.v20131127194046\r\nCLI version : 3.2.0-beta\r\nOS : MAC OSX 10.9\r\nAlloy: 1.3.0\r\nACS: 1.0.9\r\nAppcelerator Studio, build: 3.2.0.201311272052\r\ntitanium-code-processor: 1.1.0-beta\r\nXCode : 5.0.2", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-11-28T09:43:02.000+0000", "updated": "2013-11-28T09:43:02.000+0000" }, { "id": "290349", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've tested and confirmed that this is not a regression. It looks like a regression but CLI 3.2.0 is actually exposing this issue. This is because the latest CLI always target the latest SDK by default, whereas the 3.1.3 CLI targets API 10 by default. This issue is happening on API 17+ (4.2+). \n\nStarting from API 17, Android introduced @JavascriptInterface annotation that needs to be added to every function that exposes to Javascript. https://github.com/appcelerator/titanium_mobile/pull/3932 fixed most of these, but setValue() was left out. ", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-29T23:30:51.000+0000", "updated": "2014-01-29T23:30:51.000+0000" }, { "id": "290367", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/5287", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-30T00:34:05.000+0000", "updated": "2014-01-30T00:34:05.000+0000" }, { "id": "290437", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR merged", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-30T18:15:28.000+0000", "updated": "2014-01-30T18:15:28.000+0000" }, { "id": "290440", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport to 3_2_X https://github.com/appcelerator/titanium_mobile/pull/5294", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-30T18:18:52.000+0000", "updated": "2014-01-30T18:18:52.000+0000" }, { "id": "291443", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nMac OSX 10.9.2\nAppcelerator Studio, build: 3.2.1.201402041206\nTitanium SDK, build: 3.2.1.v20140203174850\nCLI: 3.2.1-beta3\nAlloy: 1.3.1-cr2\nAndroid Emulator: 2.3.3, 4.2.2 and 4.4.2\nAndroid Device: 4.4.2\n\nBoth code in description and comment passes successfully. \nClosing", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T18:18:25.000+0000", "updated": "2014-02-05T18:18:25.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }