Add support for browsers that don't nativly support window.location.origin