test: Add playwright main usage test
Some checks failed
Deploy Web Apps / deploy (push) Has been cancelled
Queue Release Build / prepare (push) Successful in 21s
Queue Release Build / build-linux (push) Successful in 27m44s
Queue Release Build / build-windows (push) Successful in 32m16s
Queue Release Build / finalize (push) Successful in 1m54s
Some checks failed
Deploy Web Apps / deploy (push) Has been cancelled
Queue Release Build / prepare (push) Successful in 21s
Queue Release Build / build-linux (push) Successful in 27m44s
Queue Release Build / build-windows (push) Successful in 32m16s
Queue Release Build / finalize (push) Successful in 1m54s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user