Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make node webkit app load full screen

Tags:

node-webkit

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?

like image 562
Jo E. Avatar asked Sep 03 '14 10:09

Jo E.


Video Answer


2 Answers

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.

like image 192
jdknight Avatar answered Oct 23 '22 04:10

jdknight


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
  }
}
like image 33
Olim Saidov Avatar answered Oct 23 '22 02:10

Olim Saidov