简体   繁体   中英

Launch browser window with parameters using Node.js

Trying develop tool using Node.js that will open new browser window with provided url and needed parameters.

Tool should work like window.open() methods.

I mean I need to hide menu bar, set size and etc.

Tried https://www.npmjs.com/package/open .

but no idea how to pass parameters like "menubar=no"

const open = require('open');

(async () => {
  await open('https://google.com', {app: ['chrome', '--incognito']});
})();

您需要设置标志:

--app="http://example.com" --force-app-mode
open.openApp(open.apps.chrome, {arguments: ['--app=https://google.com']});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM