Entretoize
Entretoize

Reputation: 2251

How to know the chromium path used by puppeteer?

I installed puppeteer on my debian server, and I'm trying to use it through php :

print shell_exec("node pptscript.js");

pptscript.js:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  await page.screenshot({path: '/var/www/web/example.png'});    
  await browser.close();
})();

But it doesn't work and I have no output.

I read somewhere that chmoding to 777 the chromium executable can solve the problem because user www-data have no right to execute it. But I don't know where is it.

Upvotes: 0

Views: 972

Answers (1)

hardkoded
hardkoded

Reputation: 21637

browser has an internal function called process() which returns a ChildProcess. You can read the spawnfile property of that ChildProcess.

console.log(browser.process().spawnfile);

Upvotes: 2

Related Questions