IE9 compatibility

Apparently IE doesn't respect window.location.origin
JI-228