frontend: FE-027 隐藏式标题栏红绿灯融入顶栏,防启动白闪与顶栏拖拽区

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
fenghp
2026-06-11 17:13:33 +08:00
co-authored by Cursor
parent 5408f27902
commit ee9e052586
6 changed files with 60 additions and 10 deletions
+11
View File
@@ -0,0 +1,11 @@
/**
* 是否运行在 macOS 的 Electron 窗口内。
* 用于判断隐藏式标题栏场景:需要为红绿灯预留空间并启用顶栏拖拽。
*/
export function isMacElectron(): boolean {
if (typeof navigator === "undefined") {
return false
}
const ua = navigator.userAgent
return ua.includes("Electron") && ua.includes("Macintosh")
}