Changed to ```window.document.host``` (reverted to default) and problems I was having on localhost went away. Thanks heaps for pointing that out. It's been bothering me for days.