{ "id": "170099", "key": "TIMOB-25434", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-12-05T18:39:24.000+0000", "created": "2017-10-24T10:51:02.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "Ingelby" ], "versions": [ { "id": "19542", "description": "", "name": "Release 6.2.2", "archived": false, "released": true, "releaseDate": "2017-09-19" } ], "issuelinks": [ { "id": "56061", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "87967", "key": "TIMOB-8013", "fields": { "summary": "iOS: WebView: beforeload event fires twice if URL is valid", "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": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-12-05T18:39:24.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": "*Problem Description:*\r\nWhen I try to load a webpage in a WebView, it shows that WebView \"beforeload\" event runs multiple times before and after the \"load\" event.\r\n\r\n*Steps to reproduce:*\r\n1. Run below code using latest SDK 6.2.2GA\r\n2. Observe the console log and you'll see beforeload event is fired multiple time after the \"load\" event\r\n\r\n*Expected:*\r\nThe beforeload event should fire once before the load event.\r\n\r\n*Actual:*\r\nBeforeload event fired multiple times before and after the load event.\r\n\r\n*Test Code:*\r\n{code}\r\nvar window = Ti.UI.createWindow();\r\n\r\nvar webview = Titanium.UI.createWebView({url:'https://www.amazon.com'});\r\n\r\nwebview.addEventListener(\"beforeload\",function(){\r\nTi.API.info(\"beforeload\");\r\n});\r\nwebview.addEventListener(\"load\",function(){\r\nTi.API.info(\"load\");\r\n});\r\nwindow.add(webview);\r\nwindow.open();\r\n{code}\r\n\r\nTest Output:\r\n{code}\r\n[DEBUG] : New scheme: { URL: https://www.amazon.com/ }\r\n[INFO] : beforeload\r\n[DEBUG] : New scheme: { URL: https://images-na.ssl-images-amazon.com/images/G/01/ape/sf/mobile/msf-1.10_FX4._V514589606_.html }\r\n[INFO] : beforeload\r\n[INFO] : load\r\n[DEBUG] : New scheme: { URL: https://s.amazon-adsystem.com/iu3?d=amazon.com&slot=navFooter&a2=010193484d71b6d1d6b622051893e17806712cacda5c462b0f43438756061e082c50&old_oo=0&cb=1508839252767 }\r\n[INFO] : beforeload\r\n[DEBUG] : New scheme: { URL: https://s.amazon-adsystem.com/iu3?d=amazon.com&slot=navFooter&a2=010193484d71b6d1d6b622051893e17806712cacda5c462b0f43438756061e082c50&old_oo=0&cb=1508839252767&dcc=t }\r\n[INFO] : beforeload\r\n[DEBUG] : New scheme: { URL: https://s.amazon-adsystem.com/v3/pr?ex-rc=ySTN_IHHQdCKB5jmd4L7-A&exlist=pp_sx_g_bsw_kr_ox_index_aold_an_fbca_aolv_twca_pm_adelphic_adb&fv=1.0&ex-pl-fbca=nEwlkpBFRZumYAgukLnB3Q&ex-pl-twca=vzOkuiYkSG6oB6VtvYR53A&a=cm&ep=9ufXSFDrukx-dtPrWJKOAJA_WyuMPClc60LpokuFPRD1xLWskFT-BQFX7l61Cq39 }\r\n[INFO] : beforeload\r\n{code}\r\n ", "attachment": [], "flagged": false, "summary": "iOS: WebView beforeload event fires multiple times before and after the load event. ", "creator": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "environment": "Appcelerator Command-Line Interface, version 6.2.4\r\nOS : \"name\": \"Mac OS X\",\r\n \"version\": \"10.12.6\",\r\n \"architecture\": \"64bit\",\r\n \"numcpus\": 4,\r\n \"memory\": 8589934592\r\n \r\nNode: \"4.8.2\"\r\nnpm : \"2.15.11\"\r\nTi SDK: \"6.2.2.GA\"\r\nPlatform: iOS\r\nPhysical Device: iPhone SE\r\nSimulator: iPhone 7plus (V11.0)\r\n ", "comment": { "comments": [ { "id": "429523", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "It looks valid to me, because it loads multiple resources inside the web-view as seen in the logs. If you compare the loaded links in the console, they are all different and likely part of a web-page. This is the intended behavior.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-24T21:08:41.000+0000", "updated": "2017-10-24T21:08:41.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }