Browsers behave differently with parsing out the host in the URL API if the protocol is a custom scheme, e.g. ssh://
.
Input:
Browser | url.protocol |
url.hostname |
url.pathname |
url.origin |
---|---|---|---|---|
Your browser |
|
|
|
|
Chrome (69.0.3497.100) | "ssh:" |
"" |
"//github.com/test/repo.git" |
"ssh://" |
Firefox (63.0b14) | "ssh:" |
"" |
"//github.com/test/repo.git" |
"null" |
Edge (42.17134.1.0, EdgeHTML 17.17134) | "ssh:" |
"github.com" |
"/test/repo.git" |
"ssh://" |
Safari (12.0, 14606.1.36.1.9) | "ssh:" |
"github.com" |
"/test/repo.git" |
"ssh://github.com" |
Node (10.10.0) | "ssh:" |
"github.com" |
"/test/repo.git" |
"null" |
whatwg-url (7.0.0) |
"ssh:" |
"github.com" |
"/test/repo.git" |
"null" |