{ "id": "172102", "key": "TIMOB-26325", "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": "20220", "name": "Release 7.3.1", "archived": false, "released": true, "releaseDate": "2018-08-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-21T20:06:07.000+0000", "created": "2018-08-20T21:20:29.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "events", "issue", "webview" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" }, { "id": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" }, { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" }, { "id": "20214", "description": "", "name": "Release 7.2.1", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "issuelinks": [ { "id": "56745", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172114", "key": "TIMOB-26330", "fields": { "summary": "Android: WebView does not load when Custom Useragent is set", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "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 } } } }, { "id": "56740", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "170191", "key": "TIMOB-25462", "fields": { "summary": "Android: webview userAgent doesn't change", "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": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2018-08-23T09:41:35.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": "Setting custom UserAgent for WebView (Android) causes WebView to not fire events (ex. load, beforeLoad and etc.).Using default UserAgent - expected behaviour, events firing.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.WebView not firing events in 7.x", "creator": { "name": "kedomuz", "key": "kedomuz", "displayName": "kedomuz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kedomuz", "key": "kedomuz", "displayName": "kedomuz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "OSX High Sierra, Appcelerator Studio 5.1.0, SDK 7.3.0, CLI 7.0.5\r\nTest device: Android 5.0.1", "closedSprints": [ { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "440906", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\n\r\nThanks for sharing with us. Are you experiencing this in all android devices? It would be great if you can share a simple test case to reproduce this on our end.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-08-21T04:55:24.000+0000", "updated": "2018-08-21T04:55:24.000+0000" }, { "id": "440917", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Also, is this happening on SDK 7.3.0 only? Could you do me a favor and check if it worked on 7.2.0.GA? Moving to TIMOB already.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-21T08:35:30.000+0000", "updated": "2018-08-21T09:38:01.000+0000" }, { "id": "440922", "author": { "name": "kedomuz", "key": "kedomuz", "displayName": "kedomuz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot edit this issue description anymore, message appeared - no permissions.\r\n\r\nLatest SDK i used 6.2.2 GA, as it was very stable, now just installed 7.3.0 GA, i have no 7.2.0 GA.\r\nExample for this issue:\r\n\r\n{code:java}\r\n$.webview.setUserAgent('Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36');\r\n$.webview.url = \"https://google.com\";\r\n//also $.webview.setUrl(\"https://google.com\") have the same unexpected behaviour - events are not firing\r\n{code}\r\n", "updateAuthor": { "name": "kedomuz", "key": "kedomuz", "displayName": "kedomuz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-21T09:53:14.000+0000", "updated": "2018-08-21T09:53:14.000+0000" }, { "id": "440924", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This is a regression of [this commit|https://github.com/appcelerator/titanium_mobile/commit/ff006d7bd16d61fcca3aefee67cb28970c05a5e6] and is happening since 7.0.0 (via TIMOB-25462), assigning to [~gmathews].", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-21T10:09:38.000+0000", "updated": "2018-08-21T13:06:43.000+0000" }, { "id": "440940", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "This is certainly related to TIMOB-25462:\r\n{code:java}\r\n// TIMOB-25462: minor 'hack' to prevent 'beforeload' and 'load' being\r\n// called when the user-agent has been changed, this is a chromium bug\r\n// https://bugs.chromium.org/p/chromium/issues/detail?id=315891\r\npublic boolean hasSetUserAgent = false;\r\n{code}\r\n\r\nI think this \"hack\" is causing the bug experienced here.\r\n\r\nI think the important thing here is:\r\n- The user agent should be set earlier in processProperties, before we attempt to set the URL/content to avoid a reload. (Maybe it doesn't matter? It's not the use case triggered here)\r\n- If the developer sets the user agent after the web view is up, I think it makes sense to reload and potentially get 2 load/beforeLoad events. Websites can offer different content based on a user agent, which is likely why Chromium does the reload. So, to avoid the double events, developers should set the user agent in the creation properties.\r\n- If we still want to keep a hack flag around for the post-load change, then I think we need the hack to be smarter and have it track event count per url. Right now it looks like we basically just swap the flag after the first load.\r\n\r\nMy personal preference is to remove this \"hack\", and add a note in the docs about point #2 above: set the user agent in the creation dictionary to avoid a reload/multiple events firing (as changing user agent can trigger a reload).\r\n\r\ncc [~gmathews] [~ybanev]", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-08-21T13:26:45.000+0000", "updated": "2018-08-21T13:26:45.000+0000" }, { "id": "440945", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "I am OK with reverting the \"hack\" part and describing the behavior resulting from changing the userAgent after the proxy creation in the documentation.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-08-21T14:20:54.000+0000", "updated": "2018-08-21T14:20:54.000+0000" }, { "id": "440949", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "7_3_X: https://github.com/appcelerator/titanium_mobile/pull/10273", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-08-21T16:34:52.000+0000", "updated": "2018-08-21T16:34:52.000+0000" }, { "id": "440962", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Merged to 7_3_X and master.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-08-21T20:06:07.000+0000", "updated": "2018-08-21T20:06:07.000+0000" }, { "id": "440996", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.3.1.v20180822075516.\r\nClosing.", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-08-22T18:54:28.000+0000", "updated": "2018-08-22T18:54:28.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }