Is it possible for Node.js running on a desktop to spawn a Chrome Browser window? I would like to start a Chrome Browser providing the window size and location when Node.js rece
I open a new firefox tab on windows here: https://github.com/Sequoia/FTWin/blob/master/FTWin.n.js
The most salient portion:
var cp = require('child_process'),
url_to_open = 'http://duckduckgo.com/';
cp.spawn('c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe', ['-new-tab', url_to_open]);
Note:
This call is the equivalent of typing "c:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab http://duckduckgo.com
at the windows command line.
For chrome you'd want something like D:\Users\sequoia\AppData\Local\Google\Chrome\Application\chrome.exe --new-tab http://duckduckgo.com/
I'll let you work out the child_process version on your own ;)
References:
http://peter.sh/experiments/chromium-command-line-switches/
http://nodejs.org/docs/v0.3.1/api/child_processes.html