{ "id": "110351", "key": "TIMOB-13145", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15277", "description": "2013 Sprint 06 Core", "name": "2013 Sprint 06 Core", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-21T18:56:05.000+0000", "created": "2013-02-28T01:15:12.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "device", "iOS", "javascript", "local", "triage", "webview" ], "versions": [], "issuelinks": [ { "id": "26687", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "109656", "key": "TIMOB-13059", "fields": { "summary": "Android: WebView: remove requirement to set baseURL", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "26746", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "87800", "key": "TIMOB-7965", "fields": { "summary": "iOS: canGoBack/canGoForward does not work for local files", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "26343", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "93365", "key": "TIMOB-9593", "fields": { "summary": "Android: Webview: Webview with HTML property having HTML content does not reload", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-04-06T08:58:32.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": [], "description": "When I have a simple webview where I set the HTML via the {{Webview.html}} property (or alternatively by later calling {{Webview.setHtml()}} method), and the HTML string contains a reference to a local javascript file which is included under my {{Resources}} project directory, the application fails to load the local javascript file. But this only happens when installed on the target device. When run in the simulator it works as expected.\r\n\r\nIf instead of creating the HTML dynamically and setting it via the {{html}} property or the {{setHtml}} method, I save the HTML to a local HTML file and load it via the {{Webview.url}} property, it then works as expected on both the simulator and the device, so the issue seems to be specifically related to the {{Webview.html}} property.\r\n\r\nAlso, in Titanium SDK 3.0.0 this worked fine, but it stopped working in 3.0.2.\r\n\r\nTo reproduce, create the following simple {{app.js}} file:\r\n{code:title=app.js}\r\nvar html=\"\" + \r\n \" \" +\r\n \" \" +\r\n \" \" +\r\n \" \" +\r\n \"

Click Me!

\" +\r\n \" \" +\r\n \"\";\r\nvar webview = Ti.UI.createWebView({\r\n html: html,\r\n top: '5%',\r\n left: '5%',\r\n right: '5%',\r\n height: '90%',\r\n willHandleTouches: false\r\n});\r\nvar win = Ti.UI.createWindow({layout: 'vertical'});\r\nwin.add(webview);\r\nwin.open();\r\n{code}\r\n\r\nAnd in {{localjs/local.js}} under {{Resources}} directory:\r\n{code:title=local.js}\r\nfunction doclick(){\r\n Ti.API.info('in local doclick function...');\r\n alert('you clicked on the webview!');\r\n}\r\n{code}\r\n\r\nThen make sure you are using SDK 3.0.2 and run {{app.js}}.\r\n\r\nExpected: The app should load up the webview, and you should be able to click on the \"Click Me!\" text and you should see the corresponding alert() and Ti.API.info message.\r\n\r\nActual: Using 3.0.2, on simulator, it works, but when you run it on the iOS device, nothing happens when you click on \"Click Me!\" text (no alert and no TI log message). And also while viewing the console log on the device via Xcode, you don't see the expected debug message saying that the {{local.js}} was loaded. If you revert to SDK 3.0.0 it works on the device as expected.\r\n\r\nFurther notes: If instead of setting the {{Webview.html}} or using the {{Webview.setHtml()}} method, you save the HTML to a local file and then load that local file in the webview via {{Webview.url}}, then it seems to work in all cases. However for my purposes I need to dynamically generate HTML so it is not an ideal workaround to use static local files.", "attachment": [], "flagged": false, "summary": "iOS: Setting WebView HTML contents directly fails to load local JavaScript file on device", "creator": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "environment": "OS: Mac OS X 10.8.2\r\nTitanium SDK: 3.0.2\r\niOS device: iPhone 3GS running iOS 6.0.1\r\nXcode: 4.6", "comment": { "comments": [ { "id": "240609", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please see if either of the related linked tickets seem similar to your issue.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-04T21:19:31.000+0000", "updated": "2013-03-04T21:19:31.000+0000" }, { "id": "241969", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Marking as duplicate. If this is an unrelated issue, please reopen.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-13T14:41:45.000+0000", "updated": "2013-03-13T14:41:45.000+0000" }, { "id": "242258", "author": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "body": "@Ingo, sorry I must have missed your comment from March 4. I have checked both of those other issues (TIMOB 9593 and TIMOB 13059), and in fact I had run across both those tickets while researching this issue. They all certainly seem to be related to WebView and the html property.\n\nHowever both of those tickets reference it as being an Android-only problem, and the workarounds/fixes might only apply to Android. This ticket deals with an issue with iOS only, and again only when the app is installed on the device, so I entered it as a new ticket. Additionally since it worked in 3.0.0 but not 3.0.2, I wanted to enter it as a new regression item. Those other tickets may have existed before this regression was introduced.\n\nBut it's certainly possible the above problem is related to the problems listed in those other tickets.", "updateAuthor": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "created": "2013-03-14T16:38:35.000+0000", "updated": "2013-03-14T16:38:35.000+0000" }, { "id": "242264", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Nathan--can you try it in 3.1.0 (master) from the CI server and see what behavior you see there?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T16:43:13.000+0000", "updated": "2013-03-14T16:43:13.000+0000" }, { "id": "242341", "author": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "body": "@Ingo unfortunately 3.1.0 (master) from CI server did NOT solve the problem. It still fails to load the local javascript file on the iOS device only (works on the simulator). I think this is a different issue than the Android issues, which seem to have been resolved according to those other items.", "updateAuthor": { "name": "bigotilda", "key": "bigotilda", "displayName": "Nathan Nadeau", "active": true, "timeZone": "America/New_York" }, "created": "2013-03-14T23:14:52.000+0000", "updated": "2013-03-14T23:14:52.000+0000" }, { "id": "243326", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I do not believe it's a regression. SDK build scripts analyze included html files for any .js references and keep these .js files as-is w/o packaging into binary. Thus making them available for WebView to load. It never worked for html property because build scripts do not process them for that purpose.\n\nHowever, with the fix made at https://github.com/appcelerator/titanium_mobile/pull/3701 it is now possible to reference packaged .js files from WebView.\n", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T00:55:23.000+0000", "updated": "2013-03-21T00:55:23.000+0000" }, { "id": "243328", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/3999", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T01:00:16.000+0000", "updated": "2013-03-21T01:00:16.000+0000" }, { "id": "246134", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "local JavaScript file ie localjs/local.js inside Resources folder is loaded on the device, when the app is executed.\r\nAlert is displayed and \"in local doclick function...\" is also logged on console.\r\n\r\nVerified on:\r\nDevice : iPad mini, iOS version: 6+\r\nSDK: 3.1.0.v20130405170202\r\nCLI version : 3.1.0-beta\r\nOS : MAC OSX 10.7.5\r\nAppcelerator Studio, build: 3.1.0.201304011603\r\nXCode : 4.5.1\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-06T08:58:32.000+0000", "updated": "2013-04-06T08:58:32.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }