Code-Samples/javascript/58.4.html location.protocol displays current page protocol. It can be either http: or https:.