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

Feature Request: Adding options for setting executablePath puppeteer option #458

Open
fatihky opened this issue Sep 20, 2020 · 0 comments
Open

Comments

@fatihky
Copy link

fatihky commented Sep 20, 2020

Hi, it seems sulla.create() doesn't have any option for setting a custom chrome/chromium executable path which is provided by puppeteer. We can pass a custom executable path via executablePath options. Fore more information, see https://github.com/puppeteer/puppeteer#default-runtime-settings.

It seems initBrowser method accepts extra argument which can be used to pass executablePath option, but that argument is not exposed to outside.
Here is initBrowser method:

async function initBrowser(
session: string,
options: CreateConfig,
extras = {}
) {
if (options.useChrome) {
const chromePath = getChrome();
if (chromePath) {
extras = { ...extras, executablePath: chromePath };
} else {
console.log('Chrome not found, using chromium');
extras = {};
}
}
// Use stealth plugin to avoid being detected as a bot
puppeteer.use(StealthPlugin());
const browser = await puppeteer.launch({
// headless: true,
headless: options.headless,
devtools: options.devtools,
userDataDir: path.join(process.cwd(), session),
args: options.browserArgs
? options.browserArgs
: [...puppeteerConfig.chroniumArgs],
...extras,
});
return browser;
}

Could you allow us to set executablePath option or expose extra argument to outside? It'd be so helpful for me. I need to set custom chrome path in order to avoid downloading chromium (I have to count my internet usage, unfortunately).

By the way, setting a custom executable path can be done with PUPPETEER_EXECUTABLE_PATH environment variable, too. See: https://github.com/puppeteer/puppeteer/blob/v5.3.0/docs/api.md#environment-variables
So setting executablePath option is not mandatory.

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

1 participant