seem windows platform restrict the cross domain access

  • 1
  • Problem
  • Updated 4 years ago
a simple code
I am using cli 6.0.0


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>XXX</title>
<script src="cordova.js" type="text/javascript"></script>
<script type="text/javascript">
document.addEventListener("deviceready", initialize, false);
function initialize()
{ window.location = "http://www.google.com"; }
</script>
</head>
<body>
</body>
</html>


in Android and iOS,it will go to the google webpage immediately
but in Windows,when I execute it,it have no any response
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes

Posted 4 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Have you tried:

{ window.location.href = "http://www.google.com"; }

? (Mind the 'href' part!)
Does it make any difference?
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi @Petra
thanks your reply
but it seem no difference...
when in previous .xap format,it work (before cli 6.0)
but when in latest .appx format,abnormal (after cli 6.0)
it you have a winphone device,you can try and you will know what I am talking about
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
If I may assume that you whitelisted correctly, I can only suggest to try and use the inappbrowser plugin with the '_self' parameter to show the external site in the webview.

I don't have a Winphone device handy now, so I can't test it myself. However, you made the issue quite clear, so I believe you immediately without getting confirmation on my device.