blob: d66646ccd892271b4cfa67fb760e5542556b2fb5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/**
* Utility functions for the terminal web client
*/
/**
* Check if the current page is served over HTTPS
* @returns {boolean} true if protocol is https:, false otherwise
*/
export function is_https() {
return document.location.protocol === "https:";
}
export function isMac() {
if (navigator.userAgentData && navigator.userAgentData.platform) {
return navigator.userAgentData.platform === "macOS";
}
return navigator.platform.toUpperCase().includes("MAC");
}
|