We have a problem when downloading a pdf document on a safari on MacOS Sierra. We get a dataUrl from a server and then use a $window.open with a createObjectURL to push the file to the browser. But all that doesn't actually matters. But here is a snippet to reproduce my problem:
myApp.controller('MyCtrl', function($scope, $window, $http) {
$scope.open = function() {
var windowy = $window.open('', '_blank');
console.log('1');
console.log(windowy);
$http.get('http://httpbin.org/delay/0').then(function(response) {
var windowx = $window.open('', '_blank');
console.log('2');
console.log(windowx);
});
}
});
I created a JsFiddle to show the problem, the url is: http://jsfiddle.net/ADukg/9023/
Here is the log from chrome (mac)
And here is the log from safari 10 (mac)
Why is the window undefined on safari in $http.get(...).then(...)