When I'm trying to use native URL API for validation purposes, surprisingly, Edge browser behaves differently. So the input of:
const myUrlString = "abfss://myprojectname/filename.csv";
const myUrl = new URL(myUrlString);
console.log(myUrl);
Note: abfss:// is Microsoft's Azure file storage protocol.
Chrome returns:
{
"hash": "",
"host": "myprojectname",
"hostname": "myprojectname",
"href": "abfss://myprojectname/filename.csv",
"origin": "null",
"password": "",
"pathname": "/filename.csv",
"port": "",
"protocol": "abfss:",
"search": "",
"username: "",
...
}
Edge returns:
{
"hash": "",
"host": "",
"hostname": "",
"href": "abfss://myprojectname/filename.csv",
"origin": "null",
"password": "",
"pathname": "//myprojectname/filename.csv",
"port": "",
"protocol": "abfss:",
"search": "",
"username": "",
...
}
Notice host and hostname being empty strings.
For some reason, it doesn't parse any URLs with non-http(s) protocol.
Does anyone know how to solve this to have uniform behavior across browsers?