No access to window.location.origin in IE11

Internet Explorer does not have access to window.location.origin. Cred
for this fix Aaron Axvig.