[#680] Fix REST adapter URL

* The `window.location.origin` is the easier way to get the protocol,
  host and port, but it seems that IE doesn't expose that property