Can Node.js invoke Chrome?

后端 未结 8 1413
长发绾君心
长发绾君心 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:17

    var exec = require('child_process').exec
    
    exec('open firefox www.google.pt' , function(err) {
    if(err){ //process error
    }
    
    else{ console.log("success open")
    }
    
    })
    

    This opens firefox in google page from a nodejs script, for chrome should be the same

提交回复
热议问题