Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to dynamically add new tabs to the chromium #5

Open
JoshanGladston opened this issue Mar 14, 2016 · 3 comments
Open

How to dynamically add new tabs to the chromium #5

JoshanGladston opened this issue Mar 14, 2016 · 3 comments

Comments

@JoshanGladston
Copy link

I want to add new tabs to the existing chromium browser and close the individual tabs once all the processes in that specific tab is completed , is there any way to do it ?

@Rob--W
Copy link
Collaborator

Rob--W commented Mar 14, 2016

By default a new browser profile is created whenever you start a new headless instance of Chrome. If you want to use a single browser profile, set the --user-data-dir= flag and pass a path to a fixed directory. Then an existing browser is re-used if available.

The browser is closed whenever any of these tabs print "All tests completed!" to the console using console.info, see https://github.com/CodeYellowBV/run-headless-chromium#example

@JoshanGladston
Copy link
Author

Thank you for your reply ,
Right now when the process in any tab is finished (the tab prints "All tests completed!" ) the entire browser is exited , instead of this behavior is it possible to close only that specific tab without stopping the processes on other tabs ?

@Rob--W
Copy link
Collaborator

Rob--W commented Mar 14, 2016

Try using window.close(); instead..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants