Reputation: 800
I have to open google chrome to a specific page after the server, written in Node.js, is ready. To do this I've used this code:
var open = require("../lib/node_modules/open");
open("localhost:4000", "chrome");
I know that exist the kiosk mode but
open("localhost:4000", "chrome --kiosk");
doesn't work.
How can I launch chrome in full screen from the Node.js server?
SOLUTION
Close all other instances of chrome and use
var childProcess = require('child_process');
childProcess.exec('start chrome --kiosk localhost:4000');
Upvotes: 3
Views: 7998
Reputation: 832
I've had a quick look at the source code for open, specifically lines 31, 40 and 47. There you can see that the appname, your second parameter "chrome --kiosk" is escaped, which will result in "chrome%20--kiosk". This makes it impossible to add parameters to the appname when using open.
So your options are to:
Upvotes: 2