Firefox bugfix

fixes bug on older versions of firefox that don't support window.location.origin