Module: Puppeteer::Launcher

Defined in:
lib/puppeteer/launcher.rb,
lib/puppeteer/launcher/chrome.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 = 800, height: 600, slowMo = 0, timeout = 30000 } = options; const { devtools = false, headless = !devtools, args = [], userDataDir = null } = options;

Defined Under Namespace

Classes: BrowserOptions, Chrome, ChromeArgOptions, 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'

Returns:



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

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

  product = product.to_s if product
  if product && product != 'chrome'
    raise ArgumentError.new("Unsupported product: #{product}. Only 'chrome' is supported.")
  end

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