{ "id": "159457", "key": "TIMOB-23186", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" }, { "id": "18141", "name": "Release 5.3.2", "archived": false, "released": true, "releaseDate": "2017-02-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-17T23:45:26.000+0000", "created": "2016-04-11T08:41:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android" ], "versions": [ { "id": "17993", "description": "Release 5.2.2", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-04-05" } ], "issuelinks": [ { "id": "51621", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "160056", "key": "TIMOB-23327", "fields": { "summary": "iOS: Webview request send out beforeload event is excuted on Webview (Parity)", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "53909", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "165243", "key": "TIMOB-24288", "fields": { "summary": "Deprecate \"onStopBlacklistedUrl\" WebView event in favor of cross-platform \"blacklisturl\" 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": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2017-01-10T09:14:45.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": "Just load any HTML url in webview and call the webview.stoploading in beforeload event of webview. Customer has blocked the \"terms of use\" and \"privacy policy\" links in \"beforeload\" event of the web view. The webView stops loading but the link is traced in Proxy.\r\n\r\n*Test code:* Sample code is attached.\r\n\r\n*Test steps:* \r\n\r\n* Import the app.\r\n* Click on \"terms of use\" and \"privacy policy” links and see the requests on proxy. \r\n\r\n\r\n*Expected Behavior :*\r\nWebview.stoploading should have prevented the request for the link clicked. \r\n\r\n*Actual Behavior :*\r\nBy clicking on \"terms of use\" and \"privacy policy” links, requests are sent out on proxy(by the IP address)", "attachment": [ { "id": "58891", "filename": "AlloyDemo (1).zip", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T08:41:05.000+0000", "size": 10479415, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: Webview request send out beforeload event is excuted on Webview", "creator": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Command-Line Interface, version 5.2.2\r\nMac OS X 10.11.1\r\nNode.js Version 4.2.2\r\nNPMp Version 2.14.7\r\nTitanium CLI Version 5.0.6\r\nTitanium SDK 5.2.2.GA\r\nTarget Platform = android,Nexus 7(6.00)", "closedSprints": [ { "id": 618, "state": "closed", "name": "2016 Sprint 08 SDK", "startDate": "2016-04-09T00:30:18.262Z", "endDate": "2016-04-23T00:30:00.000Z", "completeDate": "2016-04-25T02:38:28.511Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "382304", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "More information will be greatly appreciated.\r\nIs this a regression? Does it work on Android < 6.0? Does it work correctly on iOS?\r\nThanks.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T09:16:35.000+0000", "updated": "2016-04-11T09:16:35.000+0000" }, { "id": "382307", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Let me check. Will keep you updated.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T10:11:33.000+0000", "updated": "2016-04-11T10:11:33.000+0000" }, { "id": "382310", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~cng] Tested and got the same result on Android 4.4.2 and iPad-iOS 8.4 device.\r\n\r\nThanks", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T11:04:47.000+0000", "updated": "2016-04-11T11:04:47.000+0000" }, { "id": "382311", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Ok so you mean this is an issue seen on both iOS and Android. \r\n\r\nI haven't opened the app to see in detail but, isn't it a bit odd to block elements of a html BEFORE load on a web view? that means the \"terms of use\" and \"privacy policy\" doesn't exist during the \"beforeload\" event because the html itself isn't loaded. so I don't think it's possible to block something that's not known until it's \"loaded\". \r\n\r\nSo this may not be a valid issue for the SDK, but rather the implementation should be done in another way? it'll be much appreciated if you can verify this first. If you really can't, then I will get someone in the SDK team to investigate further.\r\n\r\nThanks for your assistance.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T11:33:13.000+0000", "updated": "2016-04-11T11:33:13.000+0000" }, { "id": "382340", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, but funny thing here is the proxy trace, it should not exist if the before load is blocking it, also this is happening for any webpage ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-11T16:55:38.000+0000", "updated": "2016-04-11T16:55:38.000+0000" }, { "id": "382929", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Classic code to reproduce:-\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'black',\r\n layout : 'vertical'\r\n});\r\n\r\nvar webview = Titanium.UI.createWebView({url:'https://en.m.wikipedia.org/wiki/Main_Page'});\r\n\r\nwebview.addEventListener('beforeload', function(e){\r\n\tTi.API.info(\"beforeload = e.url=\" + e.url);\r\n\tif(e.url.indexOf('wikimediafoundation.org/wiki/Terms_of_Use') > -1){\r\n\t\twebview.stopLoading();\r\n\t\tTi.API.info(\"Inside TERMS OF USE\");\r\n\t} else if (e.url.indexOf('wikimediafoundation.org/wiki/Privacy_policy') > -1){\r\n\t\twebview.stopLoading();\r\n\t\tTi.API.info(\"Inside privacy policy\");\r\n\t}\r\n});\r\nwebview.addEventListener('load', function(e){\r\n\tTi.API.info(\"load = e.url=\" + e.url);\r\n\t\r\n});\r\n\r\nwin.add(webview);\r\n\r\nwin.open(); \r\n{code}", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-18T05:05:38.000+0000", "updated": "2016-04-18T05:05:38.000+0000" }, { "id": "382942", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Based on this: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-event-beforeload\r\n\r\nThe request is already actually sent. The `beforeload` event is before it loads the content into the webview. `stopLoading()` stops the loading of the content into the webview. At this point, it has content and request is done. \r\n\r\nThis is how it is behaving.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-18T07:16:35.000+0000", "updated": "2016-04-18T07:16:35.000+0000" }, { "id": "382943", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~rmitro] As mentioned above, the behaviour is how it's suppose to work. Is there a need for the behaviour as mentioned in the ticket? ", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-18T07:18:01.000+0000", "updated": "2016-04-18T07:18:01.000+0000" }, { "id": "383454", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7954", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-21T02:08:54.000+0000", "updated": "2016-04-21T02:08:54.000+0000" }, { "id": "383622", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-22T03:12:24.000+0000", "updated": "2016-04-22T03:12:24.000+0000" }, { "id": "384835", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI have tested the issue with {{SDK 5.4.0.v20160429102159}} and able to reproduce.\r\n*Steps:*\r\n1. Import the test project. \r\n2. Build and run on Android Device.\r\n3. When the web page is loaded click on \"terms of use\" or \"privacy policy”.\r\n4. By clicking on \"terms of use\" and \"privacy policy” links, requests are sent out on proxy although the corresponding pages are not loaded. When the links are clicked following log is produced in proxy server.\r\n*Proxy Server Log:*\r\n{code}\r\n15:10:36.591592 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 74\r\n15:10:36.591631 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 46\r\n15:10:36.591669 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 42\r\n15:10:36.592342 IP 103.26.136.65 > 192.168.10.227: ICMP redirect text-lb.ulsfo.wikimedia.org to host gway.grameen.com, length 134\r\n15:10:36.837752 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 0\r\n15:10:36.837795 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 0\r\n15:10:36.837826 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 0\r\n15:10:36.837862 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 46\r\n15:10:36.839142 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:36.839492 IP 103.26.136.65 > 192.168.10.227: ICMP redirect text-lb.ulsfo.wikimedia.org to host gway.grameen.com, length 60\r\n15:10:38.070015 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 75\r\n15:10:38.070251 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 42\r\n15:10:38.070639 IP 103.26.136.65 > 192.168.10.227: ICMP redirect text-lb.ulsfo.wikimedia.org to host gway.grameen.com, length 135\r\n15:10:38.315649 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 0\r\n15:10:39.014283 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 74\r\n15:10:39.014655 IP 103.26.136.65 > 192.168.10.227: ICMP redirect text-lb.ulsfo.wikimedia.org to host gway.grameen.com, length 134\r\n15:10:39.021317 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 42\r\n15:10:39.260555 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1329\r\n15:10:39.260606 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1329\r\n15:10:39.260787 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.260876 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1083\r\n15:10:39.261004 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.261125 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.261404 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.263931 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.266198 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.268678 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.269335 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269372 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269434 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269462 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269668 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269861 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269925 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.269952 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.270871 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.271018 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.271063 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.272190 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.273422 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.276725 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.306144 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 0\r\n15:10:39.515558 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.515677 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 1448\r\n15:10:39.515723 IP text-lb.ulsfo.wikimedia.org.https > 192.168.10.227.50215: tcp 255\r\n15:10:39.525506 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.526124 IP 103.26.136.65 > 192.168.10.227: ICMP redirect text-lb.ulsfo.wikimedia.org to host gway.grameen.com, length 60\r\n15:10:39.528029 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.533544 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 0\r\n15:10:39.697530 IP 192.168.10.227.50215 > text-lb.ulsfo.wikimedia.org.https: tcp 75\r\n{code}\r\nThanks \r\n\r\n\r\n*Environment*:\r\n\r\n*Device info:* Nexus7 (android 6.0.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDK:* 5.4.0.v20160429102159\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.5.0", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-05-05T10:07:40.000+0000", "updated": "2016-05-05T10:07:40.000+0000" }, { "id": "384851", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~nsalahin] Which code are you using?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-05T14:13:00.000+0000", "updated": "2016-05-05T14:13:00.000+0000" }, { "id": "385865", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Reopened the ticket for the improvement.\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/8002\r\n", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-17T05:54:21.000+0000", "updated": "2016-05-18T02:24:09.000+0000" }, { "id": "385972", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR has been reviewed and merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-18T02:24:29.000+0000", "updated": "2016-05-18T02:24:29.000+0000" }, { "id": "385980", "author": { "name": "arohini", "key": "arohini", "displayName": "Ajith Rohini", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~msamah], Many thanks for your help. I am sure client will be happy and will keep you posted.", "updateAuthor": { "name": "arohini", "key": "arohini", "displayName": "Ajith Rohini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-18T02:43:50.000+0000", "updated": "2016-05-18T02:43:50.000+0000" }, { "id": "390628", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the improvement. Works as expected.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.7.0.201607111053\r\nTi SDK : 5.4.0.v20160712013704\r\nTi CLI : 5.0.9\r\nAlloy : 1.9.1\r\nMAC El Capitan : 10.11.5\r\nAppc NPM : 4.2.8-1\r\nAppc CLI : 5.4.0-33\r\nNode: 4.4.4\r\nNexus 6 - Android 6.0.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-13T20:32:19.000+0000", "updated": "2016-07-13T20:32:19.000+0000" } ], "maxResults": 52, "total": 52, "startAt": 0 } } }