Fix when $window.location.origin == undefined (IE).