How to open the window in fullscreen mode when the app starts?


I’m sure this is an easy one, but i’m not getting this to work!
Shouldn’t this code open the window in fullscreen?

app.on('ready', () => {  
    mainWindow = new BrowserWindow({
        width: 1200,
        height: 800,
        fullscreen: true
    mainWindow.loadUrl('file://' + __dirname + '/../browser/index.html');

    mainWindow.on('closed', () => {
        mainWindow = null;


I asked the same in Slack and @bengotow gave me the correct answer mainWindow.maximize() fairly obvious!


even though mainWindow.maximize() worked on this case, what the purpose of the fullscreen:true while creating a new BrowserWindow?


What if we want the application to take up all of the sceen (cover every aspect of the OS). Is this possible?

Edit: mainWindow.setFullScreen(true); does what I wanted.


Yes, my problem with using mainWindow.setFullScreen(true) was on Linux that doesn’t have a fullscreen mode. On Osx the app goes to fullscreen mode. I don’t know what happens in windows.


I am using Ubuntu 14.04 and mainWindow.setFullScreen(true) works fine for me, what versions of Linux are not supported?


hI @limoragni on windows it goes fullscreen just like any normal chrome would be expected to do.

fyi: “maximize” and “fullscreen” are two completely different things on Windows.


FWIW, @limoragni’s original code in his question was the exact answer I was looking for (at least on the windows platform)