Bug 981658 - Don't use window.location.origin