Avoid window.location.origin, for non-webkit compatibility.