Can Node.js invoke Chrome?

后端 未结 8 1412
长发绾君心
长发绾君心 2021-02-04 09:54

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

8条回答
  •  [愿得一人]
    2021-02-04 10:20

    With opn:

    const opn = require('opn');
    opn('http://siteurl.com/', {app: ['google chrome']});
    

提交回复
热议问题