299 B
299 B
title, tags
| title | tags |
|---|---|
| getProtocol | browser,beginner |
Gets the protocol being used on the current page.
- Use
Window.location.protocolto get the protocol (http:orhttps:) of the current page.
const getProtocol = () => window.location.protocol;
getProtocol(); // 'https:'