Files
coco-app/src/utils/platform.ts
ayangweb c471a83821 feat: support third party extensions (#572)
* refactor: support third party extensions

* fix tests

* fix: assistant_get error

* aaa

* bbb

* ccc

* ddd

* fix: aa

* fix: aa

* sss

* fix:asds

* eee

* refactor: loosen restriction of query string length

* fix: input auto

* feat: add ai overview trigger condition configuration

* refactor: continue chatting to select the corresponding mini-helper

* chore: settings width height

* aaa

---------

Co-authored-by: Steve Lau <stevelauc@outlook.com>
Co-authored-by: rain <15911122312@163.com>
2025-05-30 17:18:52 +08:00

40 lines
911 B
TypeScript

const navigatorPlatform = navigator.platform.toLowerCase();
console.log("navigatorPlatform", navigatorPlatform);
export const isWeb = !("__TAURI_OS_PLUGIN_INTERNALS__" in window);
export const isDesktop = true;
export const isMac = navigatorPlatform.includes("mac");
export const isWin = navigatorPlatform.includes("win");
export const isLinux = navigatorPlatform.includes("linux");
export const appScale = 1;
console.log("isMac", isMac);
console.log("isWin", isWin);
console.log("isLinux", isLinux);
export function platform() {
if (isWin) {
return "windows";
} else if (isMac) {
return "macos";
} else if (isLinux) {
return "linux";
}
return void 0;
}
export function family() {
if (isWeb) {
const ua = navigator.userAgent.toLowerCase();
if (ua.includes("windows")) {
return "windows";
} else {
return "unix";
}
} else {
return "unknown";
}
}