{ "id": "173778", "key": "AC-6291", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2019-06-19T07:52:32.000+0000", "labels": [ "8.0.1", "8.1.0.GA", "8.2.0.GA", "8.3.0", "9.0.0.RC", "ios", "webView" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-03-19T11:56:47.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I'm testing an app with sdk 8.0.1 but the webview component has changed (now is WKWebView) and fails to load a SPA with AngularJS ngRoute navigation, showing a cors error:\r\n\r\n_Cross origin requests are only supported for HTTP_\r\n\r\nThe app works fine with sdk 7.4.1.\r\nI think the problem is the WkWebView is missing property allowFileAccessFromFileURLs which seems to solve Cors issues.\r\n\r\n*To Reproduce*\r\n1 - Create a window containing a webview with url:'index.html'\r\n2 - Create index.html file containing an AngularJS single page application with angular version 1.4.7 and ngRoute navigation, for example:\r\n\r\n{code:java}\r\n\r\n\r\n \r\n test\r\n \r\n \r\n\r\n\r\n \r\n

Main

\r\n \r\n Red\r\n Green\r\n Blue\r\n \r\n
\r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n*Expected behavior*\r\nThe Angular SPA works fine with ngRoute navigation in WkWebview, as did in UIWebView.", "attachment": [ { "id": "66784", "filename": "Screen Shot 2019-07-24 at 6.43.48 PM.png", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-07-24T15:44:03.000+0000", "size": 22684, "mimeType": "image/png" }, { "id": "67089", "filename": "Screenshot 2019-10-26 at 2.22.43 PM.png", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-10-26T08:25:30.000+0000", "size": 16480, "mimeType": "image/png" }, { "id": "66857", "filename": "Simulator Screen Shot - iPad Air 2 - 2019-08-19 at 15.45.08.png", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-08-19T09:47:38.000+0000", "size": 74972, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Cors issue in WKWebView (sdk 8.0.1)", "creator": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 8.0.1", "comment": { "comments": [ { "id": "449258", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2019-06-21T11:00:54.000+0000", "updated": "2019-06-21T11:00:54.000+0000" }, { "id": "450025", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "any news? It starts getting critical because we can't migrate sdk as far as loading local templates causes cors errors.", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-24T06:44:02.000+0000", "updated": "2019-07-24T06:44:02.000+0000" }, { "id": "450029", "author": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "body": "@Portal , if you are using your own API's you can solve your issue by adding this headers to your API's that you access using a webview:\r\n\r\n'Access-Control-Allow-Origin': '*'", "updateAuthor": { "name": "fahad86", "key": "fahad86", "displayName": "Muhammad Ahmed Fahad", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2019-07-24T10:44:15.000+0000", "updated": "2019-07-24T10:44:15.000+0000" }, { "id": "450030", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Muhammad Ahmed Fahad Unfortunately the issue is not related to an API call, we can't load html files through AngularJS routing because webview doesn't trust anymore ajax calls to load resources with the file URI scheme.", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-24T10:52:05.000+0000", "updated": "2019-07-24T10:52:05.000+0000" }, { "id": "450039", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tested the sample HTML code as a local HTML file in a classic app. I don't see any error during runtime. I have tested with SDK 8.0.2.GA in iOS simulator. The webview loads fine. !Screen Shot 2019-07-24 at 6.43.48 PM.png|thumbnail! . Try with the latest SDK 8.0.2.GA. Let us know. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-07-24T15:45:00.000+0000", "updated": "2019-07-24T15:45:00.000+0000" }, { "id": "450073", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We tried updating to SDK 8.0.2.GA but keep getting the same error.\r\nTested on simulator Ipad Air 2 IOS 12.1.\r\n\r\n{code:java}\r\n[Error] Cross origin requests are only supported for HTTP.\r\n(funzione anonima) (angular.min.js:93:225)\r\np (angular.min.js:89:99)\r\n(funzione anonima) (angular.min.js:86:247)\r\n(funzione anonima) (angular.min.js:119:115)\r\n$digest (angular.min.js:130:239)\r\n$apply (angular.min.js:133:520)\r\n(funzione anonima) (angular.min.js:20)\r\nd (angular.min.js:19:489)\r\nZd (angular.min.js:19:85)\r\n(funzione anonima) (angular.min.js:293:241)\r\na (angular.min.js:174:401)\r\nc (angular.min.js:35:222)\r\n[Error] XMLHttpRequest cannot load file:///Users/sviluppo/Library/Developer/CoreSimulator/Devices/640896B1-CF62-4872-B0B8-A456BCC410EC/data/Containers/Bundle/Application/17D7E690-5EBA-4B58-BC33-194984FE1911/Test%20App.app/html/views/main.html due to access control checks.\r\n(funzione anonima) (angular.min.js:93:225)\r\np (angular.min.js:89:99)\r\n(funzione anonima) (angular.min.js:86:247)\r\n(funzione anonima) (angular.min.js:119:115)\r\n$digest (angular.min.js:130:239)\r\n$apply (angular.min.js:133:520)\r\n(funzione anonima) (angular.min.js:20)\r\nd (angular.min.js:19:489)\r\nZd (angular.min.js:19:85)\r\n(funzione anonima) (angular.min.js:293:241)\r\na (angular.min.js:174:401)\r\nc (angular.min.js:35:222)\r\n{code}\r\n\r\n", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-26T07:24:03.000+0000", "updated": "2019-07-26T07:24:03.000+0000" }, { "id": "450564", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nTested this with SDK 8.1.0.GA on Ipad Air 2 and got the following output:\r\n !Simulator Screen Shot - iPad Air 2 - 2019-08-19 at 15.45.08.png|thumbnail! \r\n\r\nCan you please test this on SDK 8.1.0.GA and let us know the result?\r\n", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-08-19T09:48:32.000+0000", "updated": "2019-08-19T09:48:32.000+0000" }, { "id": "450600", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello, we tried updating to sdk 8.1.0.GA but we keep getting this error during installation:\r\n\r\n[ERROR] : Error: spawn EACCES\r\n at _errnoException (util.js:992:11)\r\n at ChildProcess.spawn (internal/child_process.js:323:11)\r\n at exports.spawn (child_process.js:502:9)\r\n at iOSBuilder. (/Users/sara.quattrini/Library/Application Support/Titanium/mobilesdk/osx/8.1.0.GA/iphone/cli/commands/_build.js:6012:19)\r\n at Object.whilst (/Users/sara.quattrini/Library/Application Support/Titanium/mobilesdk/osx/8.1.0.GA/node_modules/async/dist/async.js:5227:5)\r\n at iOSBuilder. (/Users/sara.quattrini/Library/Application Support/Titanium/mobilesdk/osx/8.1.0.GA/iphone/cli/commands/_build.js:5999:9)\r\n at checkEntitlements (/Users/sara.quattrini/.appcelerator/install/7.0.11/package/node_modules/appc-cli-titanium/hook/titanium.js:630:15)\r\n at iOSBuilder.data.fn (/Users/sara.quattrini/.appcelerator/install/7.0.11/package/node_modules/appc-cli-titanium/hook/titanium.js:623:10)\r\n at /Users/sara.quattrini/.appcelerator/install/7.0.11/package/node_modules/titanium/lib/hook.js:256:13\r\n at /Users/sara.quattrini/.appcelerator/install/7.0.11/package/node_modules/titanium/node_modules/async/dist/async.js:3853:9\r\n\r\nCan you give us some hint to fix it?\r\nThanks", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T10:09:40.000+0000", "updated": "2019-08-20T10:09:40.000+0000" }, { "id": "450681", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nHere are a couple of things to try and let us know if this works for you.\r\n\r\n* Make sure you have the latest Appc CLI from NPM : sudo npm install -g appcelerator\r\n* To check which version you are on, run : npm list -g --depth 0 appcelerator\r\n* run the setup command with debug and trace flags turned on : DEBUG=* appc setup -l trace\r\n\r\nNext, try a clean install of your Appc CLI:\r\n\r\n* Uninstall Appc CLI from NPM global path : sudo npm uninstall -g appcelerator \r\n* Remove Appc CLI installed locally : sudo rm -rf .appcelerator \r\n* Cache clean from NPM : sudo npm cache clean \r\n* Then, reinstall Appc CLI from NPM : sudo npm install -g appcelerator \r\n* Run setup : appc setup\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-08-21T17:30:33.000+0000", "updated": "2019-08-21T17:30:33.000+0000" }, { "id": "450819", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We managed to install the app with the new SDK but it continues to fail routing showing us just a blank page.\r\nCould you share with us the working sample tested with SDK 8.1.0.GA? Could it be a problem linked to environment configuration?", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-26T12:35:25.000+0000", "updated": "2019-08-26T12:35:25.000+0000" }, { "id": "451118", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Could you share with us the working sample tested with SDK 8.1.0.GA? Could it be a problem linked to environment configuration?", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-05T12:41:03.000+0000", "updated": "2019-09-05T12:41:03.000+0000" }, { "id": "451389", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi again,\r\nany news?", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-16T08:50:46.000+0000", "updated": "2019-09-16T08:50:46.000+0000" }, { "id": "451390", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello ,\r\nCan you please test this issue on 8.1.1.GA and let us know the results?", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-09-16T08:56:14.000+0000", "updated": "2019-09-16T08:56:14.000+0000" }, { "id": "451397", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\r\nwe tested 8.1.1.GA and we are getting the same error described for 8.0.2.GA.", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-16T14:14:04.000+0000", "updated": "2019-09-16T14:14:04.000+0000" }, { "id": "452279", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\nAre you able to get that sorted out? Tested this issue on 8.2.1.GA and got the following as output:\r\n !Screenshot 2019-10-26 at 2.22.43 PM.png|thumbnail! \r\n Can you please test this on 8.2.1.GA? Please let us know if you need more help with this issue.", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-10-26T08:26:27.000+0000", "updated": "2019-10-26T08:26:27.000+0000" }, { "id": "452787", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and got same error (iOS 13.0).\r\nCould you please give us a sample code showing how you are instantiating and loading the webview?\r\nThanks", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-19T15:51:11.000+0000", "updated": "2019-11-19T15:55:52.000+0000" }, { "id": "453413", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi [~portal@quix.it], If I just add the index.html on any project then Create a window containing a webview with url:'index.html' using latest SDK 8.3.0.GA, I cannot reproduce the issue on my end. My test code is:\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar webview = Ti.UI.createWebView({\r\n\turl : 'index.html'\r\n});\r\nwin.add(webview);\r\nwin.open(); \r\n{code}\r\n\r\nCan you please test it on latest SDK and let us know if you have the same issue? Thanks", "updateAuthor": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-12-30T18:58:07.000+0000", "updated": "2019-12-30T18:58:07.000+0000" }, { "id": "453669", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Same error. The error is triggered when trying to navigate to other pages from the index (red, green or blue html from the example), index.html is correctly displayed.\r\nWe seriously need it working, we can't go on with workarounds anymore...", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-13T15:41:49.000+0000", "updated": "2020-01-13T15:41:49.000+0000" }, { "id": "454385", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "See TIMOB-27159. Probably it will fix the issue. It has new property 'assetsDirectory' which can be used to whitelist the resources. Let me know if it fixes or share a complete test app. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-02-21T18:25:24.000+0000", "updated": "2020-02-21T18:25:24.000+0000" }, { "id": "454713", "author": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unfortunately we tried and it doesn't fix the issue because the problem is not linked to titanium impossibility to load the file from resources. The WKWebView enforces strict CORS settings so angularjs is unable to load urls with file scheme.\r\nThe test described in the task is still valid... just try to navigate using angularjs routing inside the webview.", "updateAuthor": { "name": "portal@quix.it", "key": "portal@quix.it", "displayName": "Portal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-03-16T16:26:44.000+0000", "updated": "2020-03-16T16:26:44.000+0000" } ], "maxResults": 20, "total": 20, "startAt": 0 } } }