Cordova generated app have problems with the CORS


Hi guys!,

I’m building an app that is using a simple scrapper. So i call the websites with the $http service. On development i use the proxies listed based on the documentation, so far in development works great, but when i’m building the app, it doesn’t matters if it is for android or iOS, it will throw the CORS exception and the error handler of $http is executed.

Here is the controller:

function signo($scope, $stateParams, $http, $ionicLoading, FortunaService, HOROSCOPOURL, SIGNOS) {
  $scope.signo = FortunaService.signo;
  $scope.fortuna = FortunaService.fortuna = _.find($scope.signo.fortuna, { 'id': parseInt($ });
  $scope.signo.textline = '';
    content: 'Loading',
    animation: 'fade-in',
    showBackdrop: true,
    maxWidth: 200,
    showDelay: 0

  $http.get(HOROSCOPOURL + $scope.fortuna.url).then(function (xhr) {
    var parser = new DOMParser(),
        doc = parser.parseFromString(, 'text/html'),
        textline = doc.getElementById('textline').innerHTML;
    textline = textline.replace(/<br>/g, '');
    $scope.signo.textline = textline;


  }, function (error) {

  .controller('SignoCtrl', signo);

Any help to make this works would be appreciated it :smile: