Support protocol and hostname from window