18 lines
493 B
JavaScript
18 lines
493 B
JavaScript
/**
|
|
* 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");
|
|
}
|