The steps to get URL and and its parts in JavaScript are:
window.location.protocol = “http: ...