{ "id": "173873", "key": "TIMOB-27238", "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": "20832", "name": "Release 8.3.0", "archived": false, "released": true, "releaseDate": "2019-11-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-10-03T13:22:26.000+0000", "created": "2019-07-11T23:02:09.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "WebView", "android", "callback", "link", "parity" ], "versions": [], "issuelinks": [ { "id": "57818", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "173814", "key": "TIMOB-27189", "fields": { "summary": "Webview:Onlink property is not working properly", "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": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2019-10-03T13:22:26.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": "*Summary:*\r\nOn Android, the {{WebView}} \"onlink\" callback property currently must be assigned upon creation in order for it to work. It cannot be set after creation. (However, the \"onlink\" property can be changed after assigned upon creation.)\r\n\r\nNote that iOS supports setting \"onlink\" for the 1st time after creation and our API docs do not document it as a creation-only property. We should do this for convenience and parity.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-property-onlink\r\n\r\n*Test case:*\r\n# Build and run the below code on Android.\r\n# Tap on the WebView's \"Show Alert\" link.\r\n# Notice that a \"Webpage not available\" appears onscreen.\r\n# Build and run on iOS.\r\n# Tap on the WebView's \"Show Alert\" link.\r\n# Notice that an alert dialog is displayed. (The \"onlink\" callback was invoked.)\r\n\r\n{code:javascript}\r\nvar htmlText =\r\n\t\t'\\n' +\r\n\t\t'\\n' +\r\n\t\t'\t\\n' +\r\n\t\t'\t\t\\n' +\r\n\t\t'\t\\n' +\r\n\t\t'\t\\n' +\r\n\t\t'\t\t

WebView \"onlink\" Test

\\n' +\r\n\t\t'\t\t
\\n' +\r\n\t\t'\t\t
\\n' +\r\n\t\t'\t\tShow Alert\\n' +\r\n\t\t'\t\\n' +\r\n\t\t'\\n';\r\n\r\nfunction onLinkHandler(e) {\r\n\tif (e.url === \"mylink://show/alert\") {\r\n\t\talert(\"'onlink' callback invoked.\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nvar window = Ti.UI.createWindow();\r\nvar webView = Ti.UI.createWebView({\r\n\thtml: htmlText,\r\n//\tonlink: onLinkHandler, // <- Must be set upon creation to work.\r\n});\r\nwebView.onlink = onLinkHandler;\r\nwindow.add(webView);\r\nwindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Allow \"onlink\" property to be set for first time after creating WebView", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "450823", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/11176", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-08-26T15:32:05.000+0000", "updated": "2019-08-26T15:32:05.000+0000" }, { "id": "451613", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed, Waiting on Jenkins build.", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-24T16:02:42.000+0000", "updated": "2019-09-24T16:02:42.000+0000" }, { "id": "451782", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-10-02T20:29:44.000+0000", "updated": "2019-10-02T20:29:44.000+0000" }, { "id": "451809", "author": { "name": "eboateng", "key": "eboateng", "displayName": "Ebenezer Boateng", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Improvement verified in SDK version 8.3.0.v20191002165629", "updateAuthor": { "name": "eboateng", "key": "eboateng", "displayName": "Ebenezer Boateng", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-10-03T13:22:06.000+0000", "updated": "2019-10-03T13:22:06.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }