{ "id": "125872", "key": "TIMOB-16376", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": null, "resolutiondate": null, "created": "2014-02-05T00:51:55.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "exalture" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:50.000+0000", "status": { "description": "Submitted for code review", "name": "In Review", "id": "10003", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\n\r\nCurrently, the Android implementation of Titanium Mobile API, will hardcode the flags for the webview behavior like:\r\n\r\n{code}\r\nsettings.setSupportMultipleWindows(true);\r\nsettings.setJavaScriptCanOpenWindowsAutomatically(true);\r\n{code}\r\n\r\nThe user wants to be able to control those from within the JS level, in order to accomplish things like:\r\n\r\n\"I need to prevent the webview to open another window\"\r\n\r\nh4. Q&A reference\r\nhttp://developer.appcelerator.com/question/162213/webview-prevent-target-blank-from-opening-in-new-window--android-settings\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: Expose Webview's configuration flags in Android for fine tuning", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "comment": { "comments": [ { "id": "312794", "author": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "body": "Any news on this ticket? I too need the ability of running android web views in one window. Would be great if it could be included in the next release.", "updateAuthor": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-07-08T07:11:57.000+0000", "updated": "2014-07-08T07:11:57.000+0000" }, { "id": "312828", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "would you all accept a pull request for this one. \r\nThis is truly a trivial change.\r\n\r\nI would actually change the following lines (188- 194) to accept a value but leave these current values if none are set. \r\n\r\nThe file in question is android/modules/ui/src/ti/modules/titanium/ui/widget/webview/TiUIWebView again (lines 188-194):\r\n\r\n\t\tsettings.setUseWideViewPort(true);\r\n\t\tsettings.setJavaScriptEnabled(true);\r\n\t\tsettings.setSupportMultipleWindows(true);\r\n\t\tsettings.setJavaScriptCanOpenWindowsAutomatically(true);\r\n\t\tsettings.setLoadsImagesAutomatically(true);\r\n\t\tsettings.setDomStorageEnabled(true); // Required by some sites such as Twitter. This is in our iOS WebView too.\r\n\t\t\r\n\r\n@Ron I don't work for Appcelerator and I give no warranty to what I'm about to say, but if you desperately need this in a pinch then build an android module that extracts this functionality out. If someone can point me to a good way to method intercept / swizzle, then I'd hazard a module for android.\r\n", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-07-08T15:38:23.000+0000", "updated": "2014-07-08T15:38:23.000+0000" }, { "id": "312992", "author": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Andrew,\r\n\r\nI actually always wondered what exactly a pull request is. I believe it is an outside contribution to the SDK right? If you could make it so I would gladly accept it.\r\nAbout creating a module for it, I thought about it, but I'm not so into java. OBJ-C no problem but I switched to Titanium to avoid having to code in java.\r\nI think all it takes is a function that accepts a webview, sets the values and returns the web view back to titanium. I'll see if I could cook that up somewhere in the next days.", "updateAuthor": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-07-09T12:35:53.000+0000", "updated": "2014-07-09T12:35:53.000+0000" }, { "id": "314082", "author": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Andrew, \r\n\r\nWould it be possible for you to still create this pull request?\r\nI would really have no idea where to start!", "updateAuthor": { "name": "ronwondaal", "key": "ronwondaal", "displayName": "Ron Wondaal", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-07-15T07:38:34.000+0000", "updated": "2014-07-15T07:38:34.000+0000" }, { "id": "324839", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "supportMultipleWindows in webview is exposed.\r\n\r\nI think to disable opening new windows, one can attach a handler to onCreateWindow and return null, something like\r\n\r\nwebview.onCreateWindow = function() { return null;}\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/6140", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-09-20T13:21:01.000+0000", "updated": "2014-09-20T13:21:01.000+0000" }, { "id": "327281", "author": { "name": "lees_oz", "key": "lees_oz", "displayName": "Lev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Preventing opening new windows works ok if return null.\r\nIf I want to open popup contents in the same webview (like iOS does), so I do like this:\r\n{code}webView.onCreateWindow = function(e) {\r\n return webView;\r\n};{code}\r\n\r\nBut it crashes the app.\r\n\r\n\r\nAlso if I try to run the snippet from http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.WebView-property-onCreateWindow, I get a blank webview in \"New page\" tab and in console manymany logs like this: \r\n{code}[INFO] I/TiWebChromeClient.console: (main) [196,277988] Uncaught ReferenceError: TiApp is not defined (1:null){code} ", "updateAuthor": { "name": "lees_oz", "key": "lees_oz", "displayName": "Lev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-08T14:39:30.000+0000", "updated": "2014-10-08T15:21:22.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }