繁体   English   中英

在 Electron 中禁用全屏模式

[英]Disabling Full Screen Mode In Electron

当我按“f11”时,应用程序将以全屏模式出现。 如何禁用此选项?

function createWindow() {
    window = new BrowserWindow({
        width:610,
        height:679,
        icon: path.join(__dirname, APP_DIR, IMG_DIR, 'icon.png'),
        frame: false,
        resizable: false,
        webPreferences: {
            nodeIntegration: true
        }
    });

    window.loadURL(url.format({
        pathname: path.join(__dirname, APP_DIR, 'index.html'),
        protocol: 'file:',
        slashes: true
    }));
}

fullscreenable Boolean(可选) - window 是否可以进入全屏模式。 在 macOS 上,最大化/缩放按钮是否应该切换全屏模式或最大化 window。 默认为真。

来自:浏览器窗口

window = new BrowserWindow({
        width:610,
        height:679,
        icon: path.join(__dirname, APP_DIR, IMG_DIR, 'icon.png'),
        frame: false,
        fullscreenable: false,
        webPreferences: {
            nodeIntegration: true
        }
    });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM