mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-09 03:06:37 +08:00
修复部分浏览器判定为app的bug
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
NavbarBrand,
|
||||
NavbarContent,
|
||||
} from "@heroui/navbar";
|
||||
import { isWebViewFunc } from '@/utils/panel';
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import { Logo } from "@/components/icons";
|
||||
@@ -18,13 +19,7 @@ export const Navbar = () => {
|
||||
|
||||
// 检测是否在WebView中运行
|
||||
useEffect(() => {
|
||||
if((window as any).JsInterface !== undefined) {
|
||||
setIsWebView(true);
|
||||
}else if((window as any).webkit && (window as any).webkit.messageHandlers) {
|
||||
setIsWebView(true);
|
||||
}else {
|
||||
setIsWebView(false);
|
||||
}
|
||||
setIsWebView(isWebViewFunc());
|
||||
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user