396 B
396 B
title, type, language, tags, cover, dateModified
| title | type | language | tags | cover | dateModified | |
|---|---|---|---|---|---|---|
| Current page protocol | snippet | javascript |
|
bamboo-lamp | 2020-10-20T11:46:23+03:00 |
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:'