Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 21:58:35 +03:00
parent 1d189c709a
commit 61200d90c4
440 changed files with 0 additions and 0 deletions

19
snippets/get-protocol.md Normal file
View File

@ -0,0 +1,19 @@
---
title: Current page protocol
tags: browser
cover: bamboo-lamp
firstSeen: 2020-10-07T01:40:53+03:00
lastUpdated: 2020-10-20T11:46:23+03:00
---
Gets the protocol being used on the current page.
- Use `Window.location.protocol` to get the protocol (`http:` or `https:`) of the current page.
```js
const getProtocol = () => window.location.protocol;
```
```js
getProtocol(); // 'https:'
```