Fix for lack of window.location.origin on firefox