mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
feat: 添加托盘最小化通知;禁用 F12 键事件监听
This commit is contained in:
@@ -33,6 +33,12 @@ export async function initAll(isOnBoot: boolean) {
|
||||
if (setting.settings.bootAsMinimized && !isDev) {
|
||||
const appWindow = getCurrentWindow();
|
||||
appWindow.hide();
|
||||
sendNotification({
|
||||
title: "VTsuru.Client",
|
||||
body: '已启动并最小化到托盘',
|
||||
silent: false,
|
||||
extra: { type: 'question-box' },
|
||||
});
|
||||
}
|
||||
}
|
||||
let permissionGranted = await isPermissionGranted();
|
||||
@@ -113,6 +119,16 @@ export async function initAll(isOnBoot: boolean) {
|
||||
|
||||
appWindow.setMinSize(new PhysicalSize(720, 480));
|
||||
|
||||
// 监听f12事件
|
||||
if (!isDev) {
|
||||
window.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'F12') {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
clientInited.value = true;
|
||||
}
|
||||
export function OnClientUnmounted() {
|
||||
|
||||
Reference in New Issue
Block a user