on macOS, open/close Settings with Cmd+,
This commit is contained in:
parent
741102d6eb
commit
da383611c0
1 changed files with 12 additions and 0 deletions
|
|
@ -157,6 +157,18 @@ export function createMainWindow() {
|
||||||
} else {
|
} else {
|
||||||
mainWindow.webContents.openDevTools({ mode: "detach" });
|
mainWindow.webContents.openDevTools({ mode: "detach" });
|
||||||
}
|
}
|
||||||
|
} else if (
|
||||||
|
input.meta &&
|
||||||
|
input.key === "," &&
|
||||||
|
process.platform === "darwin"
|
||||||
|
) {
|
||||||
|
mainWindow.webContents.executeJavaScript(`(() => {
|
||||||
|
var escButton = document.querySelector("#floating .top_0 > button");
|
||||||
|
var settingsPanel = document.querySelector("#root div[aria-label='Settings'] > a");
|
||||||
|
|
||||||
|
if (escButton) escButton.click();
|
||||||
|
if (!escButton && settingsPanel) settingsPanel.click();
|
||||||
|
})();`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue