Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set loading background color of node-webkit window

Tags:

node-webkit

In node-webkit, how can I set the background color of the window while the page is loading? It seems to always be white, but I would either like it to be transparent, or (in my case) a shade of green.

I've tried setting transparent: true in the window option of package.json, but it doesn't seem to have any effect.

like image 330
Michal Charemza Avatar asked Jan 04 '14 19:01

Michal Charemza


1 Answers

Taking from the answers at https://groups.google.com/forum/#!topic/node-webkit/NxhJ4dO80Gc you can avoid showing the window on load by setting the show option in package.json

"window": {
  "show" false
}

And then once the application has loaded, you can use

var win = gui.Window.get();
win.show();

to show the window.

However, when combined with kiosk mode, then the behaviour of this isn't quite as nice as I would like, at least on a mac, as there are appearances of full-screen black or white before the window is shown.

like image 56
Michal Charemza Avatar answered Jan 04 '23 13:01

Michal Charemza