Stop using window.location.origin which Opera doesn't support.