예 - URL에서 프로토콜: http
예 - URL에서 프로토콜: https
/* 전체 URL 예: https://www.example.com/products/list?page=1#review */
console.log(location.protocol); // console.log(window.location.protocol)과 동일
// 출력: "https:"
const currentProtocol = location.protocol;

if(currentProtocol === "https:") {
    console.log("안전한 HTTPS 연결입니다.");
} else if(currentProtocol === "http:") {
    console.log("보안이 적용되지 않은 HTTP 연결입니다.");
} else {
    console.log("다른 프로토콜: " + currentProtocol);
}