make node webkit app load full screen

Jo E. picture Jo E. · Sep 3, 2014 · Viewed 10.9k times · Source

I'm trying to build a node-webkit app, currently I'm experimenting on package.json

Here is the contents so far:

{
  "name": "nw-demo",
  "main": "index.html",
  "window": {
    "title": "node-webkit demo",
    "icon": "icon.png",
    "toolbar": false,
    "frame": true,
    "fullscreen": true
  }
}

How do I make my node-webkit app load on fullscreen?

Docs says:

(boolean) whether window is fullscreen (available after node-webkit v0.3.0)

So why didn't the above package.json work?

Answer

jdknight picture jdknight · Oct 13, 2014

Confirmed. Full screen on v0.10.5 (node.js v0.11.13-pre) doesn't work for me either on Windows. I can notice it attempts to full screen but then goes back to a window for some reason.

This isn't an ideal answer, but this is a workaround I've been using:

<!DOCTYPE html>
<html>
<head>
    <title>Hello World!</title>
</head>
<body>
    <h1>Hello World!</h1>
    <script>
    var ngui = require('nw.gui');
    var nwin = ngui.Window.get();
    nwin.enterFullscreen();
    </script>
</body>
</html>

Full screen still works via the JavaScript call.