removes window.location.origin

isn't compatible with Internet Explorer

Fixes #5323