gpt4 book ai didi

google-chrome - 如何在 Electron 中启用 "Press ESC to exit full screen mode"

转载 作者:行者123 更新时间:2023-12-03 12:34:19 25 4
gpt4 key购买 nike

如何在 中启用“按 ESC 退出全屏模式消息” Electron 当我在 iframe 中全屏显示时?

2019-11-06_13-01-16

观察 :在 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;
}
});

代码和原始答案hereZen .

关于google-chrome - 如何在 Electron 中启用 "Press ESC to exit full screen mode",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58731443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com