Skip to content

refactor: remove browserPoolOptions from BrowserCrawler#3785

Open
yuvrajsingh2428 wants to merge 2 commits into
apify:v4from
yuvrajsingh2428:remove-browserPoolOptions-v4
Open

refactor: remove browserPoolOptions from BrowserCrawler#3785
yuvrajsingh2428 wants to merge 2 commits into
apify:v4from
yuvrajsingh2428:remove-browserPoolOptions-v4

Conversation

@yuvrajsingh2428

Copy link
Copy Markdown

Summary

  • remove browserPoolOptions from BrowserCrawler
  • require passing a pre-instantiated browserPool when custom browser pool configuration is needed
  • update PlaywrightCrawler, PuppeteerCrawler, and StagehandCrawler to create a default BrowserPool when one is not provided
  • update the Camoufox template to use browserPool

Closes #3728

@yuvrajsingh2428 yuvrajsingh2428 changed the title Remove browser pool options v4 refactor: remove browserPoolOptions from BrowserCrawler Jun 25, 2026
@barjin barjin changed the base branch from master to v4 June 26, 2026 09:40
@janbuchar janbuchar requested a review from barjin June 30, 2026 11:43
@B4nan B4nan added the t-tooling Issues with this label are in the ownership of the tooling team. label Jun 30, 2026

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yuvrajsingh2428 for drafting this PR.

I believe the original request feature has design flaws. Let us discuss this before proceeding with work on this PR.

Cheers!

// Disable the default fingerprint spoofing to avoid conflicts with Camoufox.
useFingerprints: false,
},
}),

@barjin barjin Jul 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces PlaywrightCrawler's implicit BrowserPool with the right browserPlugins: [playwrightLauncher.createBrowserPlugin()] (the custom instance doesn't have any browserPlugins)

I'm afraid the current BrowserPool design (with library-specific launchers) forbids us from dropping the browserPoolOptions from BrowserCrawler. Any user trying to customize BrowserPool options for a crawler would have to pass the right browserPlugins (and make sure these match the BrowserCrawler subclass they are using).

In the end, I'd now rather keep browserPoolOptions / browserPool for simplicity.

cc @janbuchar wdyt ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

That makes sense. I followed the direction from the issue discussion and assumed that requiring a pre-instantiated browserPool would be preferable to exposing two configuration paths.

I agree that, with the current BrowserPool design, users would also need to know how to provide the correct browserPlugins for the crawler they're using, which leaks implementation details and makes simple customization harder.

I'm happy to adapt the PR based on the outcome of the discussion between you and @janbuchar, or close it if the consensus is to keep supporting both browserPoolOptions and browserPool.

@yuvrajsingh2428

Copy link
Copy Markdown
Author

@janbuchar @barjin Just following up on the discussion above. I'm happy to either adapt this PR to a revised approach or close it if the consensus is to keep supporting both browserPoolOptions and browserPool. Please let me know which direction you'd prefer, and I'll take care of the next steps. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove browserPoolOptions from BasicCrawler constructor

4 participants