getProtocol
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:'
Gets the protocol being used on the current page.
Window.location.protocol to get the protocol (http: or https:) of the current page.const getProtocol = () => window.location.protocol;getProtocol(); // 'https:'