replace hardcoded origin with current window origin