Ask node how to automatically open the browser and open the specified web address.
Js opens browser.
Open the system default browser. For example, if you set firfox as the default browser, it will open firefox. Create a new js file with the following contents:
var c = require('child_process'); c.exec('start http://www.baidu.com');
Then execute it!
Open a specific browser, such as chrome.
var c = require('child_process') c.exec("C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe http://sosout.com/"); //The browser installation directory is in front, followed by an open link.
Using the third-party library, it is recommended to useopnThis library has been optimized.