IE does not support window.location.origin. Build it up instead.