URL.protocol

URL 인터페이스의 protocol 속성은 URL의 프로토콜 스킴과 마지막 ':'을 포함한 USVString입니다.

주의: 이 기능은 Web Worker에서 사용할 수 있습니다.

구문

const protocol = url.protocol
url.protocol = newProtocol

USVString.

예제

const url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol');
console.log(url.protocol); // Logs "https:"

명세

Specification Status Comment
URL
The definition of 'protocol' in that specification.
Living Standard Initial definition.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
protocolChrome Full support YesEdge Full support 13Firefox Full support 22IE ? Opera Full support YesSafari Full support 10WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 22Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

같이 보기

  • 속성이 속한 URL 인터페이스.