Files
lan-manager/web/node_modules/@probe.gl/env/dist/esm/lib/get-browser.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

44 lines
949 B
JavaScript

import isBrowser from './is-browser';
import isElectron from './is-electron';
const window = globalThis;
export function isMobile() {
return typeof window.orientation !== 'undefined';
}
export default function getBrowser(mockUserAgent) {
if (!mockUserAgent && !isBrowser()) {
return 'Node';
}
if (isElectron(mockUserAgent)) {
return 'Electron';
}
const navigator_ = typeof navigator !== 'undefined' ? navigator : {};
const userAgent = mockUserAgent || navigator_.userAgent || '';
if (userAgent.indexOf('Edge') > -1) {
return 'Edge';
}
const isMSIE = userAgent.indexOf('MSIE ') !== -1;
const isTrident = userAgent.indexOf('Trident/') !== -1;
if (isMSIE || isTrident) {
return 'IE';
}
if (window.chrome) {
return 'Chrome';
}
if (window.safari) {
return 'Safari';
}
if (window.mozInnerScreenX) {
return 'Firefox';
}
return 'Unknown';
}
//# sourceMappingURL=get-browser.js.map