Class: Puppeteer::Launcher::Firefox::DefaultArgs
- Inherits:
-
Object
- Object
- Puppeteer::Launcher::Firefox::DefaultArgs
- Includes:
- Enumerable
- Defined in:
- lib/puppeteer/launcher/firefox.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(chrome_arg_options) ⇒ DefaultArgs
constructor
A new instance of DefaultArgs.
Constructor Details
#initialize(chrome_arg_options) ⇒ DefaultArgs
Returns a new instance of DefaultArgs.
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/puppeteer/launcher/firefox.rb', line 213 def initialize() firefox_arguments = ['--no-remote'] if Puppeteer.env.darwin? firefox_arguments << '--foreground' elsif Puppeteer.env.windows? firefox_arguments << '--wait-for-browser' end if .user_data_dir firefox_arguments << "--profile" firefox_arguments << .user_data_dir end if .headless? firefox_arguments << '--headless' end if .devtools? firefox_arguments << '--devtools' end if .args.all? { |arg| arg.start_with?('-') } firefox_arguments << 'about:blank' end firefox_arguments.concat(.args) @firefox_arguments = firefox_arguments end |
Instance Method Details
#each(&block) ⇒ Object
244 245 246 247 248 |
# File 'lib/puppeteer/launcher/firefox.rb', line 244 def each(&block) @firefox_arguments.each do |opt| block.call(opt) end end |