如何在 中启用“按 ESC 退出全屏模式消息” Electron 当我在 iframe 中全屏显示时?
观察 :在 Chrome 中具有相同选项的相同 iframe 会显示消息,但 Electron 不会。
最佳答案
最简单的方法是使用 remote
进行一些简单的窗口控制。模块。
const remote = require("electron").remote;
document.addEventListener("keydown", event => {
switch (event.key) {
case "Escape":
if (remote.getCurrentWindow().isFullScreen()) {
remote.getCurrentWindow().setFullScreen(false);
}
break;
}
});
代码和原始答案here由 Zen .
关于google-chrome - 如何在 Electron 中启用 "Press ESC to exit full screen mode",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58731443/