{ "id": "63755", "key": "TIMOB-3123", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-02T10:53:33.000+0000", "created": "2011-04-15T03:37:29.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "klist", "module_webview", "parity", "qe-testadded", "reported-1.6.0", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-04-02T10:53:33.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": "{html}

Android \"APIs 2.2\" / Titanium 1.6.0 (11 Feb 2011)

\r\n

It isn't surprising that this does not work, but I am creating\r\nthe ticket in the interests of completeness, as the issue has been\r\nopened for iOS in ticket #1603 and seems to be confirmed by core\r\ndevs. Note that the iOS ticket claims that these types of links can\r\nbe browsed on iOS 4.

\r\n

Clicking a link in a webview that has a target (new, blank) that\r\nwould ordinarily open a new window in a standard browser is\r\nignored. The following code demonstrates the behavior:

\r\n
\r\nvar win = Ti.UI.createWindow({\r\n    backgroundColor: 'white',\r\n    exitOnClose:true\r\n});\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar webView = Ti.UI.createWebView({\r\n    url: \"http://www.cnn.com/2010/TECH/social.media/08/12/delta.facebook.ticket.window/index.html\",\r\n    top: 0,\r\n    left: 0,\r\n    width: '100%',\r\n    height: '100%'  \r\n});\r\n\r\nwebView.addEventListener('load',function(e) {\r\n    Ti.API.info(\"Load event caught with: \" + e.url);\r\n});\r\n\r\nwebView.addEventListener('beforeload',function(e) {\r\n    Ti.API.info(\"beforeload event caught with: \" + e.url);\r\n});\r\n\r\nwin.add(webView);\r\n\r\nwin.open();\r\n
\r\n

The built-in browser does recognize the\r\nlink:

\r\n
\r\nvar win = Ti.UI.createWindow({\r\n    backgroundColor: 'white',\r\n    exitOnClose:true\r\n});\r\n\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nwin.open();\r\nTi.Platform.openURL('http://www.cnn.com/2010/TECH/social.media/08/12/delta.facebook.ticket.window/index.html');\r\n
{html}", "attachment": [], "flagged": false, "summary": "Android: webview link with new or blank target (ie \"popup\") does not open", "creator": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [ { "id": "130120", "author": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "body": "{html}

I've confirmed this as well. target _blank will not open at all\nin our webView. On iOS it opens in the current webView in which it\nwas clicked.

\n

HD ticket: http://developer.appcelerator.com/helpdesk/view/76367

{html}", "updateAuthor": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "created": "2011-04-15T03:37:30.000+0000", "updated": "2011-04-15T03:37:30.000+0000" }, { "id": "130121", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

rplist'd, klist'd, added TBS Milestone

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:37:30.000+0000", "updated": "2011-04-15T03:37:30.000+0000" }, { "id": "171026", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Bug is still valid, occurs in:\r\nTiMOB sdk version: 1.8.0.v20111031173855\r\nStudio version: 1.0.6.201110251616\r\nOS version: Mac OS X Lion\r\nDevices tested on: Droid 2.2.2, Galaxy Tab 3.1", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-11-01T08:44:07.000+0000", "updated": "2011-11-01T08:44:07.000+0000" }, { "id": "181134", "author": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another case here:\r\nhttp://support-admin.appcelerator.com/display/APP-871916\r\n\r\nThe web view is loaded on iOS, but not on android.\r\n", "updateAuthor": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-30T16:01:48.000+0000", "updated": "2012-01-30T16:01:48.000+0000" }, { "id": "181177", "author": { "name": "gosi", "key": "gosi", "displayName": "Daniel Urstoeger", "active": true, "timeZone": "America/Los_Angeles" }, "body": "you can temporary fix it like this:\r\n{code}\r\nwebview.addEventListener('load',function(e)\r\n{\r\n var content = webview.evalJS(\"document.body.innerHTML = document.body.innerHTML.replace(/target=\\\"_blank\\\"/gi,'');\");\r\n});\r\n{code}", "updateAuthor": { "name": "gosi", "key": "gosi", "displayName": "Daniel Urstoeger", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-31T05:50:14.000+0000", "updated": "2012-01-31T05:52:19.000+0000" }, { "id": "187724", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening bug. Still persists on:\r\n\r\nSDK build: 2.0.0.v20120321071752\r\nRuntime: v8, rhino\r\nTitanium Studio, build: 2.0.0.201203202130\r\nDevice: Droid 1 (2.2.3)\r\n\r\nNote:\r\n* Above code still works on iOS\r\n* I noticed some interesting logs in logcat. But, not sure if it's related:\r\n{code}\r\nI/TiWebChromeClient.console( 1823): (main) [1303,48838] Uncaught illegal access (1:https://s-static.ak.facebook.com/xd_localstorage/v2)\r\nI/TiAPI ( 1823): Load event caught with: http://www.cnn.com/2010/TECH/social.media/08/12/delta.facebook.ticket.window/index.html\r\nI/TiWebChromeClient.console( 1823): (main) [1167,50005] Uncaught illegal access (1:https://s-static.ak.facebook.com/xd_localstorage/v2)\r\n{code}", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T10:04:52.000+0000", "updated": "2012-03-21T10:04:52.000+0000" }, { "id": "187964", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-22T08:56:31.000+0000", "updated": "2012-03-22T08:56:31.000+0000" }, { "id": "189496", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening/closing to add/remove labels", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-02T10:52:20.000+0000", "updated": "2012-04-02T10:52:20.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }