How to use the puppeteer-firefox.executablePath function in puppeteer-firefox

To help you get started, we’ve selected a few puppeteer-firefox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github treosh / exthouse / src / utils / measure-firefox.js View on Github external
exports.measureFirefox = async function(url, ext) {
  let extensionRunners
  let browser

  if (ext.path) {
    // @todo wait for https://github.com/sindresorhus/get-port/pull/28 and than use range for 6000 port
    const CDPPort = await getPort()

    extensionRunners = await webExt.cmd.run(
      {
        sourceDir: ext.path,
        // comment if connect to default FF
        firefox: PP_FF.executablePath(),
        args: [`-juggler=${CDPPort}`]
      },
      {
        // These are non CLI related options for each function.
        // You need to specify this one so that your NodeJS application
        // can continue running after web-ext is finished.
        shouldExitProgram: false
      }
    )

    const browserWSEndpoint = `ws://127.0.0.1:${CDPPort}`
    browser = await PP_FF.connect({
      browserWSEndpoint
    })
  } else {
    browser = await PP_FF.launch({
github treosh / exthouse / src / execute-with-puppeteer.js View on Github external
const measureExtensionInFirefox = async ({ extension, extName, url, extPath }) => {
  let extensionRunners
  let browser

  if (extPath) {
    // @todo wait for https://github.com/sindresorhus/get-port/pull/28 and than use range for 6000 port
    const CDPPort = await getPort()

    extensionRunners = await webExt.cmd.run(
      {
        sourceDir: extPath,
        // comment if connect to default FF
        firefox: PP_FF.executablePath(),
        args: [`-juggler=${CDPPort}`]
      },
      {
        // These are non CLI related options for each function.
        // You need to specify this one so that your NodeJS application
        // can continue running after web-ext is finished.
        shouldExitProgram: false
      }
    )

    const browserWSEndpoint = `ws://127.0.0.1:${CDPPort}`
    browser = await PP_FF.connect({
      browserWSEndpoint
    })
  } else {
    browser = await PP_FF.launch({

puppeteer-firefox

Puppeteer API for Firefox

Apache-2.0
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages