Some browsers don't support document.location.origin