[GH-2857] Allow only macOS to call setSecureKeyboardEntryEnabled (#2860)

This commit is contained in:
Devin Binnie
2023-09-28 11:07:58 -04:00
committed by GitHub
parent f4cf612e21
commit 2a88175b09

View File

@@ -149,6 +149,10 @@ export function handlePingDomain(event: IpcMainInvokeEvent, url: string): Promis
} }
export function handleToggleSecureInput(event: IpcMainEvent, secureInput: boolean) { export function handleToggleSecureInput(event: IpcMainEvent, secureInput: boolean) {
if (process.platform !== 'darwin') {
return;
}
// Enforce macOS to restrict processes from reading the keyboard input when in a password field // Enforce macOS to restrict processes from reading the keyboard input when in a password field
log.debug('handleToggleSecureInput', secureInput); log.debug('handleToggleSecureInput', secureInput);
app.setSecureKeyboardEntryEnabled(secureInput); app.setSecureKeyboardEntryEnabled(secureInput);