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

Remote Chrome for puppeteer instance for JavaScript rendering #262

Open
Waffleophagus opened this issue Nov 24, 2024 · 0 comments
Open

Remote Chrome for puppeteer instance for JavaScript rendering #262

Waffleophagus opened this issue Nov 24, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Waffleophagus
Copy link

Description
You use Browsershot to reach out to a puppeteer instance and then a headless instance of Chrome. Browsershot has the ability to use a remote instance of headless Chrome, for instance something like Browserless. https://spatie.be/docs/browsershot/v4/miscellaneous-options/connection-to-a-remote-chrome-instance

To my understanding, at the moment, Roach does not enable this functionality. It would be useful to allow for better management of servers, not running chrome on the server that is storing the data.

Proposed solution
I already wrote a solution, this is more or less asking if you’d like a PR. It’s a one file change as it stands, ExecuteJavascriptMiddleware.php that checks for the existence of some environment variables, and if they exist, set up to use the remote instance of Chrome with Browsershot. I’d be down to tweak it if there is some other method you’d prefer, but it is working via an override, I’d love to make it official.

Considered alternatives
Given I have a one file change that works for me currently I haven’t really thought of alternatives.

Additional context
Having Chrome be on a different server than the server hosting my site gives good separation of concerns, on top of allowing the scraping to occur on a different IP address than the server hosting my site.

@Waffleophagus Waffleophagus added the enhancement New feature or request label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants