Closed unional closed 8 years ago
stop
is the only event a local instance sends and having it fire right away when the browser is already open is because the process launchpad starts in that case does terminate right after it opened the tab.
I do not know of a cross-platform way to figure out when that browser has actually been closed.
I see. And chrome internally create another process to host the tab? My understanding is that each chrome tab is a standalone process.
Tabs are child process of the chrome main process but if it is open already the default behaviour of running Chrome from the command line is to just add the tab to the existing main process. It would be possible to to open a new instance with profile support (see #11).
Thanks for the clarification. I'll not listen to the stop event in the time being.
I don't think it's too hard to crack, basically you just have to generate a temporary profile name and figure out what the command line parameters are the browser need to initialize with a new profile. I personally didn't need it yet (launchpad was mostly for kicking off browsers on CI servers where you have a new system every time) but can help if someone would like to tackle it.
For now, I'll close this as an duplicate for #11
I run the following on vscode debug and
npm start
, same result:The
Browser closed
is printed out when the tab on the browser just created and loading the page.This does work if there is no pre-existing chrome instance, i.e. When there is no chrome instance exists, running this code will create a new chrome window and the
stop
event is not fired. When I close the window, thenstop
event is fired correctly.Where can I find information on the events?