Module: Puppeteer::Launcher

Defined in:
lib/puppeteer/launcher.rb,
lib/puppeteer/launcher/chrome.rb,
lib/puppeteer/launcher/firefox.rb,
lib/puppeteer/launcher/launch_options.rb,
lib/puppeteer/launcher/browser_options.rb,
lib/puppeteer/launcher/chrome_arg_options.rb

Overview

const

ignoreDefaultArgs = false,
args = [],
dumpio = false,
executablePath = null,
pipe = false,
env = process.env,
handleSIGINT = true,
handleSIGTERM = true,
handleSIGHUP = true,
ignoreHTTPSErrors = false,
defaultViewport = {width: 800, height: 600,
slowMo = 0,
timeout = 30000

} = options; const {

devtools = false,
headless = !devtools,
args = [],
userDataDir = null

} = options;

Defined Under Namespace

Classes: BrowserOptions, Chrome, ChromeArgOptions, Firefox, LaunchOptions

Class Method Summary collapse

Class Method Details

.new(project_root:, preferred_revision:, is_puppeteer_core:, product:) ⇒ Puppeteer::Launcher::Chrome

Parameters:

  • project_root (String)
  • prefereed_revision (String)
  • is_puppeteer_core (String)
  • product (String)

    ‘chrome’ or ‘firefox’

Returns:



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/puppeteer/launcher.rb', line 14

module_function def new(project_root:, preferred_revision:, is_puppeteer_core:, product:)
  unless is_puppeteer_core
    product ||= ENV['PUPPETEER_PRODUCT']
  end

  if product == 'firefox'
    return Firefox.new(
      project_root: project_root,
      preferred_revision: preferred_revision,
      is_puppeteer_core: is_puppeteer_core,
    )
  end

  Chrome.new(
    project_root: project_root,
    preferred_revision: preferred_revision,
    is_puppeteer_core: is_puppeteer_core,
  )
end