{ "id": "87967", "key": "TIMOB-8013", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-06-19T20:47:18.000+0000", "created": "2012-03-14T14:36:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "15758", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "64002", "key": "TIMOB-3370", "fields": { "summary": "iOS: WebView: fires load event multiple times", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "15766", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "87972", "key": "TIMOB-8018", "fields": { "summary": "Android: WebView: beforeload event fires twice if url is invalid", "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": "56061", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "170099", "key": "TIMOB-25434", "fields": { "summary": "iOS: WebView beforeload event fires multiple times before and after the load event. ", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-10-24T11:23:29.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": "WebView beforeload event is fired twice if a valid URL is loaded. An invalid url will only fire the beforeload event once (as expected).\r\n\r\nWorks correctly on Android (one beforeload event is fired when a valid URL is loaded).\r\n\r\nSteps to Reproduce:\r\n\r\n1. Run code, press 'Open Google'.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'blue'\r\n});\r\n\r\nvar buttonGoogle = Ti.UI.createButton({\r\n\ttitle:'Open Google',\r\n\ttop:'20%',\r\n\theight:'30%',\r\n\tleft:'10%',\r\n\tright:'10%'\r\n});\r\n\r\nbuttonGoogle.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView({\r\n\t\t\turl:'http://www.google.com'\r\n\t\t});\r\n\t\r\n\twebView.addEventListener('load', function(){\r\n\t\talert('load: ' + webView.url);\r\n\t\t});\r\n\t\r\n\twebView.addEventListener('beforeload', function(){\r\n\t\talert('beforeload: ' + webView.url);\r\n\t\t});\r\n\t\t\r\n\twebView.addEventListener('error', function(){\r\n\t\talert('error: ' + webView.url);\r\n\t\t});\r\n\t\t\r\n\twin.add(webView);\r\n\t\r\n\tvar button = Ti.UI.createButton({\r\n\t\ttitle:'Close',\r\n\t\tright:0,\r\n\t\tbottom:0,\r\n\t\theight:'10%',\r\n\t\twidth:'20%'\r\n\t});\r\n\t\r\n\tbutton.addEventListener('click', function(){\r\n\t\twin.remove(webView);\r\n\t});\r\n\t\r\n\twebView.add(button);\r\n});\r\n\r\nwin.add(buttonGoogle);\r\n\r\nvar buttonInvalid = Ti.UI.createButton({\r\n\ttitle:'Open Invalid URL',\r\n\tbottom:'20%',\r\n\theight:'30%',\r\n\tleft:'10%',\r\n\tright:'10%'\r\n});\r\n\r\nbuttonInvalid.addEventListener('click', function(){\r\n\tvar webView = Ti.UI.createWebView({\r\n\t\t\turl:'http://xxx'\r\n\t\t});\r\n\t\r\n\twebView.addEventListener('load', function(){\r\n\t\talert('load: ' + webView.url);\r\n\t\t});\r\n\t\r\n\twebView.addEventListener('beforeload', function(){\r\n\t\talert('beforeload: ' + webView.url);\r\n\t\t});\r\n\t\t\r\n\twebView.addEventListener('error', function(){\r\n\t\talert('error: ' + webView.url);\r\n\t\t});\r\n\t\t\r\n\twin.add(webView);\r\n\t\r\n\tvar button = Ti.UI.createButton({\r\n\t\ttitle:'Close',\r\n\t\tright:0,\r\n\t\tbottom:0,\r\n\t\theight:'10%',\r\n\t\twidth:'20%'\r\n\t});\r\n\t\r\n\tbutton.addEventListener('click', function(){\r\n\t\twin.remove(webView);\r\n\t});\r\n\t\r\n\twebView.add(button);\r\n});\r\n\r\nwin.add(buttonInvalid);\r\n\r\nwin.open();\r\n{code}\r\n\r\nExpected Result:\r\n\r\nOnly one beforeload event should fire.\r\n\r\nActual Result:\r\n\r\nTwo beforeload events fire.", "attachment": [], "flagged": false, "summary": "iOS: WebView: beforeload event fires twice if URL is valid", "creator": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK: 1.8.2 githash=59b3a90s, 2.0.0.v20120314120250\r\nStudio: 2.0.0.201203121914\r\nOS: Snow Leopard\r\nDevices Tested: iPad 4.3.5, iPhone Simulator 5.0", "comment": { "comments": [ { "id": "245657", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \n\nTested with\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \niOS iPhone Simulator: iOS SDK version: 6.0", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-04T04:34:53.000+0000", "updated": "2013-04-04T04:34:53.000+0000" }, { "id": "422298", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am unable to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170609091155\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-19T20:47:18.000+0000", "updated": "2017-06-19T20:47:18.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }