{ "id": "83242", "key": "TIMOB-6387", "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": "12088", "description": "", "name": "Sprint 2011-48", "archived": true, "released": true, "releaseDate": "2011-12-05" }, { "id": "12571", "description": "CI for 1_7_X", "name": "Release 1.7.6", "archived": true, "released": false }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-03-14T13:25:13.000+0000", "created": "2011-11-30T12:25:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "merge-1.7.6", "module_webview", "qe-testadded" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "15753", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "87955", "key": "TIMOB-8007", "fields": { "summary": "iOS: The Webview's \"error\" event is not handled properly and cause crash. Part II: Edge Cases.", "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 } } } }, { "id": "16602", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "87977", "key": "TIMOB-8021", "fields": { "summary": "Android: WebView: error event not fired when invalid url loaded", "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 } } } } ], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-01-15T10:16:43.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The \"error\" event is not handled properly in WebView and crash the app.\r\n\r\nh4. Repro Steps\r\nStep 1. Create a project based on the following code.\r\nStep 2. Input \"www.yahoo.com,\" and return. The webview will open up it correctly\r\nStep 3. Input some random word and hit enter. the app would crash.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\n\r\nvar input = Ti.UI.createTextArea({\r\n\ttop:40,\r\n\theight:60,\r\n\tborderColor:'#333',\r\n\tborderRadius: 10,\r\n\tautocapitalization:Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE\r\n});\r\n\r\nfunction makeweb(url2){\r\n\tvar web = Ti.UI.createWebView({\r\n\t\thtml:null,\r\n\t\turl:url2\r\n\t});\r\n\tvar window = Titanium.UI.createWindow({});\r\n\t\r\n\t//\r\n\t//\r\n\t// Attaching the 'error' event listener results in a crash on poorly formed URLS\r\n\t//\r\n\t//\r\n\tweb.addEventListener('error', function(e) {\r\n\t\talert('error');\r\n\t});\r\n\t\r\n\twindow.add(web);\r\n\treturn window;\r\n};\r\n\r\nwin.add(input);\r\n\r\ninput.addEventListener('return', function(e) {\r\n\tvar link = input.value.toString();\r\n\tweb = makeweb('http://'+link);\r\n\tweb.open();\r\n});\r\nwin.addEventListener('open', function() {\r\n\tinput.focus();\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "24389", "filename": "testLinkCrash_2011-11-30-094839_qgaombp.crash", "author": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-30T12:25:55.000+0000", "size": 40881, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: The Webview's \"error\" event is not handled properly and cause crash.", "creator": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS5 Simulator, Xcode4.2", "comment": { "comments": [ { "id": "174894", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested on Ti Studio 1.0.7.201112041107\r\nTi Mob SDK 1.8.0.1.v20111205011857\r\nOSX Lion\r\niPod Touch 4.3.5, iPhone 4S OS 5.0.1, iPad 2 OS 4.3.5\r\n\r\nExpected behavior shown of proper error handling with a invalid url", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T13:12:37.000+0000", "updated": "2011-12-05T13:12:37.000+0000" }, { "id": "178031", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Open to add label", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T15:13:47.000+0000", "updated": "2012-01-04T15:13:47.000+0000" }, { "id": "186364", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Bug still exists under certain conditions:\r\n\r\n- Invalid characters such as: % and : (ascii 37 and 58).\r\n- Spaces in the url.\r\n\r\nSDK: 1.8.2 githash=59b3a90s, 2.0.0.v20120312213243\r\nStudio: 2.0.0.201203121914\r\nOS: Snow Leopard\r\nDevices Tested: iPod 4.3.3, iOS Simulator 5.0\r\n\r\nCrash does not occur on Android.\r\n\r\nSteps to Reproduce:\r\n\r\n1. Run code below.\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'blue',\r\n\ttop:0,\r\n\tlayout:'vertical'\r\n\t});\r\n\t\r\nvar asciiButton = Ti.UI.createButton({\r\n\ttitle:'ascii char url test',\r\n\ttop:0,\r\n\twidth:'100%',\r\n\theight:'20%'\r\n});\r\n\r\nasciiButton.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView();\r\n\t\r\n\twin.add(webView);\r\n\t\r\n\tvar asciiCount = 1024;\r\n\t\r\n\tfor(var i = 0; i < asciiCount; i++)\r\n\t{\t\t\r\n\t\tvar string = String.fromCharCode(i);\r\n\t\t\r\n\t\tTi.API.info(i + ': ' + string);\r\n\t\t\r\n\t\twebView.url = string;\r\n\t}\r\n\t\r\n\twin.remove(webView);\r\n});\r\n\r\nwin.add(asciiButton);\r\n\r\nvar intButton = Ti.UI.createButton({\r\n\ttitle:'int url test',\r\n\twidth:'100%',\r\n\ttop:0,\r\n\theight:'20%'\r\n});\r\n\r\nintButton.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView();\r\n\t\r\n\twin.add(webView);\r\n\t\r\n\tvar intCount = 2500;\r\n\t\r\n\tfor(var i = 0; i < intCount; i++)\r\n\t{\r\n\t\tvar string = i.toString();\r\n\t\t\r\n\t\tTi.API.info(i + ': ' + string);\r\n\t\t\r\n\t\twebView.url = string;\r\n\t}\r\n\t\r\n\twin.remove(webView);\r\n});\r\n\r\nwin.add(intButton);\r\n\r\nvar floatButton = Ti.UI.createButton({\r\n\ttitle:'float url test',\r\n\twidth:'100%',\r\n\ttop:0,\r\n\theight:'20%'\r\n});\r\n\r\nfloatButton.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView();\r\n\t\r\n\twin.add(webView);\r\n\t\r\n\tvar floatCount = 10.0;\r\n\t\r\n\tfor(var i = 0.0; i < floatCount; i += 0.01)\r\n\t{\r\n\t\tvar string = i.toString();\r\n\t\t\r\n\t\tTi.API.info(i + ': ' + string);\r\n\t\t\r\n\t\twebView.url = string;\r\n\t}\r\n\t\r\n\twin.remove(webView);\r\n});\r\n\r\nwin.add(floatButton);\r\n\r\nvar objectButton = Ti.UI.createButton({\r\n\ttitle:'object url test',\r\n\twidth:'100%',\r\n\ttop:0,\r\n\theight:'20%'\r\n});\r\n\r\nobjectButton.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView();\r\n\t\r\n\twin.add(webView);\r\n\t\r\n\tvar objectList = [\r\n\t\ttrue,\r\n\t\t{},\r\n\t\t[],\r\n\t\t1,\r\n\t\t0.9,\r\n\t\tnull,\r\n\t\tundefined\r\n\t];\r\n\t\r\n\tfor(var i in objectList)\r\n\t{\r\n\t\tvar object = objectList[i];\r\n\t\t\r\n\t\tTi.API.info(i + ': ' + object);\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\twebView.url = object;\r\n\t\t}\r\n\t\tcatch(e)\r\n\t\t{\r\n\t\t\tTi.API.info(e.toString());\r\n\t\t}\r\n\t}\r\n\t\r\n\twin.remove(webView);\r\n});\r\n\r\nwin.add(objectButton);\r\n\r\nvar urlStringButton = Ti.UI.createButton({\r\n\ttitle:'url string url test',\r\n\twidth:'100%',\r\n\ttop:0,\r\n\theight:'20%'\r\n});\r\n\r\nurlStringButton.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView();\r\n\t\r\n\twin.add(webView);\r\n\t\r\n\tvar urlList = [\r\n\t\t'www.yahoo.com',\r\n\t\t'www.notarealwebsiteatall.com',\r\n\t\t's p a c e s'\r\n\t];\r\n\t\r\n\tfor(var i in urlList)\r\n\t{\r\n\t\tvar url = 'http://';\r\n\t\t\r\n\t\turl += urlList[i];\r\n\t\t\r\n\t\tTi.API.info(i + ': ' + url);\r\n\t\t\r\n\t\twebView.url = url;\r\n\t}\r\n\t\r\n\twin.remove(webView);\r\n});\r\n\r\nwin.add(urlStringButton);\r\n\r\nwin.open();\r\n{code}\r\n\r\n2. Click 'ascii char url test' or 'url string url test'.\r\n\r\nExpected Result:\r\n\r\nApp should not crash.\r\n\r\nActual Result:\r\n\r\nApp crashes.", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-13T18:34:50.000+0000", "updated": "2012-03-13T18:34:50.000+0000" }, { "id": "186476", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-14T13:25:13.000+0000", "updated": "2012-03-14T13:25:13.000+0000" }, { "id": "281116", "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:24.000+0000", "updated": "2013-11-25T08:50:24.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }