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

Launching multiple browser instances and manage events #2670

Closed
mhaseebkhan opened this issue Jun 4, 2018 · 7 comments
Closed

Launching multiple browser instances and manage events #2670

mhaseebkhan opened this issue Jun 4, 2018 · 7 comments

Comments

@mhaseebkhan
Copy link

I am working on a project which involves a multi-user scenario.

The use-case is such that multiple users can hit an end-point for information which involves launching puppeteer and browsing through various URLs.

In the implementation, if the puppeteer instance launched completes its end to end execution in one go for a single user, then, everything works great, however, if there is a puppeteer execution in process and another request comes in which tries to use the same codebase, then, everything breaks. Even the first request isn't completed.

My question is from a design and implementation perspective as what are the best practices recommended by the puppeteer community to tackle multi-user scenarios. Any examples will certainly be very helpful.

@mhaseebkhan
Copy link
Author

mhaseebkhan commented Jun 18, 2018

I have tried using BrowserContext as well, using which, I can open multiple browser windows, however, as soon as the second browser window is opened, events for the first one are swallowed.

How can I launch multiple browser windows such that each window is responsible for handling and managing its respective events?

@aslushnikov: Your input in this regard will be highly appreciated.

@mhaseebkhan mhaseebkhan changed the title Multi-user scenarios handling in puppeteer Launching multiple browser instances and manage events Jun 18, 2018
@aslushnikov
Copy link
Contributor

if there is a puppeteer execution in process and another request comes in which tries to use the same codebase, then, everything breaks. Even the first request isn't completed.

@mhaseebkhan I don't quite follow this scenario. Can you come up with a small runnable script that illustrates the issue?

@mhaseebkhan
Copy link
Author

@aslushnikov: Here is a test script containing a README with instructions.

Please have a look and suggest.

@zouhair94
Copy link

i face the same problem right now if there is any solution

@levelingup
Copy link

+1 would like to know.

1 similar comment
@magnnus
Copy link

magnnus commented Apr 7, 2020

+1 would like to know.

@rajkumar3223
Copy link

+1

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

6 participants