10

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?

Jo E.
  • 7,822
  • 14
  • 58
  • 94
  • The above code worked fine for me. What version of node-webkit are you using? – gotohales Sep 04 '14 at 15:50
  • @gotohales I did a `process.version` and it says `v0.11.13-pre`. I'm gonna try older versions and see what will happen. At least I have confirmation that the code is right. thanks! – Jo E. Sep 05 '14 at 13:18

2 Answers2

10

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.

jdknight
  • 1,801
  • 32
  • 52
4

Nw.js has a special kiosk mode:

{
  "name": "nw-demo",
  "main": "index.html",
  "window": {
    "title": "node-webkit demo",
    "icon": "icon.png",
    "toolbar": false,
    "frame": true,
    "kiosk": true // set kiosk mode true
  }
}
Olim Saidov
  • 2,796
  • 1
  • 25
  • 32