Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling Full Screen Mode In Electron

When I press 'f11' the app will appear in the full-screen mood. How I can disable this option?

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
    }));
}
like image 780
Ali Ahmadi Avatar asked Mar 09 '26 04:03

Ali Ahmadi


1 Answers

fullscreenable Boolean (optional) - Whether the window can be put into fullscreen mode. On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. Default is true.

From: BrowserWindow

window = new BrowserWindow({
        width:610,
        height:679,
        icon: path.join(__dirname, APP_DIR, IMG_DIR, 'icon.png'),
        frame: false,
        fullscreenable: false,
        webPreferences: {
            nodeIntegration: true
        }
    });
like image 145
tpikachu Avatar answered Mar 10 '26 16:03

tpikachu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!