Hi Rajil, Thanks for your patience.
I will follow your steps to reproduce this issue, and reply you as soon as possible. Thanks, Junwei. From: Rajil [mailto:[email protected]] Sent: Thursday, November 27, 2014 1:32 PM To: Fu, Junwei; [email protected]; Pierre Gaston; crosswalk-help Subject: Re: Re: [Crosswalk-help] Crosswalk Cordova 10 - External URL Hi Junwei; You mentioned that you can open baidu(http://www.baidu.com<http://www.baidu.com/>), and can authenticate. Are you redirecting to that URL or authenticating using $http from angular code? I can open external URL by setting content tag in config.xml (cordova configuration file). But can not authenticate via $http. You can check via following steps: 1) Create ionic project. (reference: http://ionicframework.com/getting-started/) using following commands: ionic start myApp sidemenu cd myApp $ ionic platform add android $ ionic build android 2) I changed login.html and controller.js as attached. You can just replace these files in created newly created myApp project. Notes: 1) This project is running fine with cordova 3.5 and crosswalk 9. It doesn't give Access-Control-Allow-Origin error. while calling url using $http 2) This project also is running fine with cordova3.6 and without crosswalk. 3) But gives error with cordova 3.6 and crosswalk 10. Error after clicking login button: 11-26 07:00:56.981: I/chromium(2147): [INFO:CONSOLE(0)] "XMLHttpRequest cannot load https://www.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'file://' is therefore not allowed access. The response had HTTP status code 405.", source: file:///android_asset/www/index.html#/app/playlists<file:///\\android_asset\www\index.html#/app/playlists> (0) 11-26 07:00:56.991: I/chromium(2147): [INFO:CONSOLE(43)] "Error in login 0", source: file:///android_asset/www/js/controllers.js<file:///\\android_asset\www\js\controllers.js> (43) I couldn't add attachments, hence mentioning changes as below: Login.html file: <div class="modal"> <ion-header-bar> <h1 class="title">Login</h1> <div class="buttons"> <button class="button button-clear" ng-click="closeLogin()">Close</button> </div> </ion-header-bar> <ion-content> <form ng-submit="doLogin()"> <div class="list"> <label class="item item-input"> <span class="input-label">Username</span> <input type="text" ng-model="user.username"> </label> <label class="item item-input"> <span class="input-label">Password</span> <input type="password" ng-model="user.password"> </label> <label class="item"> <button class="button button-block button-positive" type="submit">Log in</button> </label> </div> </form> </ion-content> </div> changes in controller.js file: just change $scope.doLogin function gas given below: $scope.doLogin = function() { var URL = "https://www.google.com"; console.log('Doing login', $scope.user); $http({ url: URL, data: angular.toJson($scope.user), method: "POST", headers:{'Content-Type' : 'application/jsonp'}, dataType: "jsonp" }) .success(function(data, status, headers, config) { console.log('Login with status '+data.status+" : msg : "+data.token); }).error(function(data, status, headers, config) { console.log('Error in login '+status); }); // Simulate a login delay. Remove this and replace with your login // code if using a login system $timeout(function() { $scope.closeLogin(); }, 1000); }; Now you are done. Check this app with cordova 3.5 and crosswalk cordova 9. Thenafter, check this app with cordova 3.6.3 and crosswalk cordova 10 beta. It will give error while calling URL. regards, Rajil Davda Applied Software On Wed, Nov 26, 2014 at 5:43 PM, Rajil <[email protected]<mailto:[email protected]>> wrote: Hi Junwei; You mentioned that you can open baidu(http://www.baidu.com<http://www.baidu.com/>), and can authenticate. Are you redirecting to that URL or authenticating using $http from angular code? I can open external URL by setting content tag in config.xml (cordova configuration file). But can not authenticate via $http. You can check via following steps: 1) Create ionic project. (reference: http://ionicframework.com/getting-started/) using following commands: ionic start myApp sidemenu cd myApp $ ionic platform add android $ ionic build android 2) I changed login.html and controller.js as attached. You can just replace these files in created newly created myApp project. Notes: 1) This project is running fine with cordova 3.5 and crosswalk 9. It doesn't give Access-Control-Allow-Origin error. while calling url using $http 2) This project also is running fine with cordova3.6 and without crosswalk. 3) But gives error with cordova 3.6 and crosswalk 10. Error after clicking login button: 11-26 07:00:56.981: I/chromium(2147): [INFO:CONSOLE(0)] "XMLHttpRequest cannot load https://www.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'file://' is therefore not allowed access. The response had HTTP status code 405.", source: file:///android_asset/www/index.html#/app/playlists<file:///\\android_asset\www\index.html#/app/playlists> (0) 11-26 07:00:56.991: I/chromium(2147): [INFO:CONSOLE(43)] "Error in login 0", source: file:///android_asset/www/js/controllers.js<file:///\\android_asset\www\js\controllers.js> (43) regards, Rajil Davda Applied Software On Fri, Nov 21, 2014 at 6:18 PM, Fu, Junwei <[email protected]<mailto:[email protected]>> wrote: Thank you very much. I will analyze it. Junwei. From: Rajil [mailto:[email protected]<mailto:[email protected]>] Sent: Friday, November 21, 2014 4:58 PM To: Fu, Junwei Cc: [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]> Subject: Re: Re: [Crosswalk-help] Crosswalk Cordova 10 - External URL Hi Junwei; Thanks for the reply. I can't share my current app code. I'm preparing simple example for the same let you know. For the more information, I am using crosswalk with ionic based cordova application. Also, i'm using https domain to authenticate user. Without crosswalk this project is running fine. With crosswalk 10 beta, this is giving Access-Control-Allow-Origin error. regards, Rajil Davda Applied Software On Fri, Nov 21, 2014 at 2:22 PM, Fu, Junwei <[email protected]<mailto:[email protected]>> wrote: It would be helpful if you could share your code or simplify your usage scenario to reproduce the issue. Thanks, Junwei From: Fu, Junwei Sent: Friday, November 21, 2014 4:35 PM To: '[email protected]<mailto:[email protected]>'; '[email protected]<mailto:[email protected]>'; '[email protected]<mailto:[email protected]>' Subject: Re: [Crosswalk-help] Crosswalk Cordova 10 - External URL Hi Pierre, > Hi, in my case loading an external using an external url like > www.google.com<http://www.google.com> was fine, but loading a cordova > application from an http server was not working while the exact same > application using file:///<file:///\\> was fine. > My problem was as stated in the initialization, it received a null pointer > exception because loadedUrl in CordovaBridge is null. Could you please try to test it without crosswalk, only use Cordova. We will fix it in Cordova upstream if it also exist the issue. Hi Rajil, Dave, Pierre > As soon as I upgraded my application to cordova 3.6.3 now and > crosswalk cordova 10, I started getting error "No > 'Access-Control-Allow-Origin' > header is present on the requested resource." while calling external > URL to authenticate user login. Could you please show your use case to me, I can’t reproduce this issue. Thanks, Junwei.
_______________________________________________ Crosswalk-help mailing list [email protected] https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
