test: Add playwright main usage test
Some checks failed
Queue Release Build / prepare (push) Successful in 17s
Deploy Web Apps / deploy (push) Has started running
Queue Release Build / build-windows (push) Has been cancelled
Queue Release Build / finalize (push) Has been cancelled
Queue Release Build / build-linux (push) Has been cancelled

This commit is contained in:
2026-04-11 16:48:26 +02:00
parent f33440a827
commit b10004e154
21 changed files with 1002 additions and 6 deletions

View File

@@ -535,4 +535,26 @@ export function setupSystemHandlers(): void {
request.end();
});
});
ipcMain.handle('context-menu-command', (_event, command: string) => {
const allowedCommands = ['cut', 'copy', 'paste', 'selectAll'] as const;
if (!allowedCommands.includes(command as typeof allowedCommands[number])) {
return;
}
const mainWindow = getMainWindow();
const webContents = mainWindow?.webContents;
if (!webContents) {
return;
}
switch (command) {
case 'cut': webContents.cut(); break;
case 'copy': webContents.copy(); break;
case 'paste': webContents.paste(); break;
case 'selectAll': webContents.selectAll(); break;
}
});
}