-
Notifications
You must be signed in to change notification settings - Fork 210
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 do I specify "executablePath" when calling Puppeteer #2000
Comments
Thanks for opening your first issue here! This space is protected by our Code of Conduct - and we're here to help. |
Ah, hmm, it's supposed to run headless actually! We have CLI based tests too... https://github.com/publiclab/image-sequencer/blob/main/test/cli/saveSequence.js I think it's supposed to simply skip GL acceleration if it's not available. What sequence are you trying to run? Let me try to reproduce. As to different headless browser, we do use Puppeteer, which i believe now supports firefox headless. I'm not sure where we can specify that but we should be able to pass in an option, i think... were you more interested in how to NOT rely on a headless browser at all, or in how to rely on a non-Chrome headless browser? |
The sequence is "fisheye-gl". My environment is NodeJS v16, DietPi (Raspberry Pi 4). There's no GUI. When I ran this particular sequence to fix distorted images, it would try to launch a headless Chrome (via Puppeteer) to process them. Since Chome is not available on Raspberry Pi, I needed to manually add "executablePath: '/usr/bin/chromium-browser'" to gl-context.js (src/modules/_nomodule/gl-context.js: line 12) so that it can invoke the correct browser which is Chromium. It seemed to use Chrome by default. Does it mean "fisheye-gl" must require a headless browser? If so, how can I run this sequence in an environment without Chrome? If you could just pass in an option for people to specify a different headless browser, that would be great. Is it possible? Thanks. |
fisheye-gl requires a GPU. I think that's what you're tweaking in gl-context... but ok, great, so let's try to find a place to put a configurable flag. Tracing the call, your modification was here:
So we would pass in the option to the three modules that use it. I think we can do something like we do with the let sequencer = ImageSequencer({headlessBrowserExecutablePath: '/usr/bin/chromium-browser'}) Then we'd insert that on line 12 of let puppeteerOptions = {
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
if (options.headlessBrowserExecutablePath) puppeteerOptions. executablePath = options.headlessBrowserExecutablePath;
puppeteer.launch(puppeteerOptions).then(function(browser) { Plus we'd want to add to the README a note just below the |
How does that sound? Do you have any interest or capacity to give this a try, or would you like my support in getting this going? Thanks! |
I'm trying to run it on a Raspberry PI, but it gives me an error saying "Failed to launch chrome".
To make it work, I have to manually add "executablePath: '/usr/bin/chromium-browser'" to gl-context.js
Is it possible to add an option for users to run a different headless browser? Thanks.
The text was updated successfully, but these errors were encountered: