I was inspired by this link open browser with nodejs. Now I am wondering if programmer can open several different chrome profiles at once? For instance this is the capture of the profiles of my chrome setting.
X1
and X2
are two different users which have independent caches. And I would like to invoke same url www.stachoverflow.com
at once for these two accounts. Is it possible to do it?
Asked
Active
Viewed 1,315 times
1

Lbj_x
- 415
- 5
- 15
2 Answers
1
You can do it by using the opn
package as described in your link and providing profile-directory
argument, e.g.
opn('https://www.google.com', {app: ['google chrome', '--profile-directory="User1"']});
opn('https://www.google.com', {app: ['google chrome', '--profile-directory="User2"']});

bredikhin
- 8,875
- 3
- 40
- 44
0
If I understand right.
1) You can run Chrome with some user using terminal. There’s a simple example https://askubuntu.com/questions/681163/is-it-possible-to-create-new-user-profile-by-using-command-line-for-chrome
2) If you can run by terminal you can run it by ‘child_process’ inbuilt node.js module. There is the API (see below). I guess You need ‘exec(...)’ function of ‘child_process’ module. https://nodejs.org/api/child_process.html.

Bogdan Surai
- 1,197
- 14
- 16
-
Thank you for the hint, however, I would like to use node.js and do some operations with after I open the chrome to the specific website like click buttons etc. – Lbj_x Oct 31 '18 at 13:56
-
1Does opn package allow to click buttons? Do you consider puppeteer for your intention? It can open chromium and allows to manage pages. https://github.com/GoogleChrome/puppeteer/blob/master/README.md – Bogdan Surai Nov 01 '18 at 04:58