mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
18 lines
445 B
TypeScript
18 lines
445 B
TypeScript
import { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
|
|
|
export function isElectron() {
|
|
return 'electronAPI' in window && window.electronAPI !== undefined
|
|
}
|
|
|
|
export function electronAPI() {
|
|
return (window as any).electronAPI as ElectronAPI
|
|
}
|
|
|
|
export function showNativeSystemMenu() {
|
|
electronAPI()?.showContextMenu()
|
|
}
|
|
|
|
export function isNativeWindow() {
|
|
return isElectron() && !!window.navigator.windowControlsOverlay?.visible
|
|
}
|