0

I am developing a mobile application, I am trying to embed a website into my page whose URL comes from the controller.

In controller

.controller('DescCtrl',['$http','$scope','$state','$sce',function($http,$scope,$state,$sce){ 
    //var project=JSON.parse(sessionStorage.project);
    //$scope.projectName=project.name

    $scope.Back = function () {
        $state.go('task');
    }; 

    $scope.descUrl= $sce.trustAsResourceUrl(sessionStorage.taskUrl+"&output=embed");
    if(sessionStorage.taskUrl!=undefined && sessionStorage.taskUrl!="" ||sessionStorage.taskUrl!=null)
        $scope.isShown="display:none"
    else{
        $scope.isShown=""
    }


}])

I wrote code above this send URL to html. As a way, I tried to use IFrame

 <iframe ng-src="{{descUrl}}" frameborder="0" style="overflow:hidden;height:100%;width:100%;{{isShown}}" height="100%" width="100%"></iframe>

Here the problem is that not all pages is shown due to SAME ORIGIN header of websites. For example ;www.google.com.tr

I couldn't find any other solution, How can I do it, I have to soleve today this problem,

Thanks in advance

laktherock
  • 427
  • 4
  • 19
mr. pc_coder
  • 16,412
  • 3
  • 32
  • 54
  • What serverside tech are you using? You may need to fix the problem on your server. see https://enable-cors.org/server.html – Adam Diament Jul 20 '17 at 11:04
  • Possible duplicate of https://stackoverflow.com/questions/24446797/how-to-resolve-cors-ie-same-origin-policy-in-angularjs – Adam Diament Jul 20 '17 at 11:05

0 Answers0