{ "id": "98725", "key": "TIMOB-10323", "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": "15931", "description": "2014 Sprint 05", "name": "2014 Sprint 05", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15934", "description": "2014 Sprint 05 Tooling", "name": "2014 Sprint 05 Tooling", "archived": true, "released": true, "releaseDate": "2014-03-14" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-23T02:24:29.000+0000", "created": "2012-08-06T11:25:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core", "mobileweb", "qe-closed-3.3.0", "qe-testadded", "supportTeam" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "35567", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "126997", "key": "TIMOB-16527", "fields": { "summary": "Windows Hybrid: cannot trap events from webviews embedded in window", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-05-06T23:07:40.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "Unable to run anything Ti in a webView (We should be able to use info and fireEvent).\r\n\r\nh4. Steps to reproduce:\r\n1. Run the code below\r\n2. notice the error: \"Ti is not defined\"\r\n\r\nh5. app.js\r\n{code:js}\r\nvar win = Ti.UI.createWindow();\r\nwin.open();\r\n\r\nvar webView = Ti.UI.createWebView({\r\n\turl: 'test.html'\r\n});\r\nwin.add(webView);\r\n{code}\r\n\r\nh5. test.html\r\n{code:html}\r\n\r\n\r\n\tWebview Logging\r\n\t\r\n\t\r\n\r\n\r\n\t
Look at the log and make sure you see 10 log statements with webview: prefix.
\r\n\t
Look ma... UTF-8
\r\n\t
餵 こんにちは 안녕하세요 Привет Γειά हैलो สวัสดี שלום
\r\n\t
⓼ ⑆ ش Ⴔ € ぇ ⌘ ᚎ ᑺ ༀ Җ ℥
\r\n\t
ド標準第5版の刊行を大いに
\r\n\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "MobileWeb: WebView - Ti is not defined in a script in a webview", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 2.2.0.v20120710122120\r\nGoogle Chrome Version 21.0.1180.57\r\n", "comment": { "comments": [ { "id": "213726", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Edited the wrong ticket by accident.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-09T21:49:05.000+0000", "updated": "2012-08-09T21:49:36.000+0000" }, { "id": "213728", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "As documented in the Mobile Web limitations wiki page, if you want to execute code in a WebView that uses the Ti or Titanium globals, you MUST wrap your code in an onload handler.\r\n\r\nFurthermore, some browsers will fire the window.onload event before the iframe's load event, so you'll need to wrap the code again in a setTimeout():\r\n\r\n{code}\r\nwindow.onload = function() {\r\n setTimeout(function() {\r\n Ti.API.log(\"hi from the webview\");\r\n }, 25);\r\n};\r\n{code}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-08-09T21:59:13.000+0000", "updated": "2012-08-09T21:59:13.000+0000" }, { "id": "219327", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This seeing this issue\r\n\r\nh5. test.html\r\n{code:js}\r\n\r\n\r\n\tWebview Logging\r\n\t\r\n\t\r\n\r\n\r\n\t
Look at the log and make sure you see 10 log statements with webview: prefix.
\r\n\t
Look ma... UTF-8
\r\n\t
餵 こんにちは 안녕하세요 Привет Γειά हैलो สวัสดี שלום
\r\n\t
⓼ ⑆ ش Ⴔ € ぇ ⌘ ᚎ ᑺ ༀ Җ ℥
\r\n\t
ド標準第5版の刊行を大いに
\r\n\r\n\r\n{code}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-17T13:00:03.000+0000", "updated": "2012-09-17T13:00:03.000+0000" }, { "id": "295623", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5423\n3_2_X_hybrid pull request: https://github.com/appcelerator/titanium_mobile/pull/5424", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-03-04T21:38:39.000+0000", "updated": "2014-03-04T21:38:39.000+0000" }, { "id": "295624", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Here's the test case:\n\nh4. app.js\n\n{code}\nvar win = Titanium.UI.createWindow({\n backgroundColor: '#fff'\n});\n\nTi.App.addEventListener('foo', function (evt) {\n\tconsole.log(evt);\n});\n\nvar webview = Ti.UI.createWebView({\n\turl: 'test.html'\n});\n\nwin.add(webview);\n\nwin.open();\n{code}\n\nh4. test.html\n\n{code}\n\n\n\n\n\n\n\n\n\n\n{code}\n\nh4. Expected Result\n\nIn the console:\n\n{code}\n[INFO] Appcelerator Titanium 3.3.0 Mobile Web\n[INFO] it works! 1393968546491\n{code}\n\nThen click the button:\n\n{code}\n[INFO] it works! 1393968547423 (index):2591\nObject {data: 123, source: Object, type: \"foo\"}\n{code}\n\nNOTE: The number is a timestamp that will obviously be different for you.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-03-04T21:41:04.000+0000", "updated": "2014-03-04T21:41:04.000+0000" }, { "id": "303732", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Used [~cbarber] test case\r\nMac osx 10.9.2 Mavericks\r\nAppcelerator Studio, build: 3.3.0.201405011408\r\nTitanium SDK, build: 3.3.0.v20140505115416\r\nNode.JS Version: v0.10.13\r\nNPM Version: 1.3.2\r\n acs@1.0.14\r\n alloy@1.4.0-dev\r\n npm@1.3.2\r\n titanium@3.3.0-dev\r\n titanium-code-processor@1.1.1\r\nSafari 7.0.3\r\nChrome 34.0.1847.131\r\nVerified the expected result is correct.\r\n", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-06T23:06:57.000+0000", "updated": "2014-05-06T23:06:57.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }