Class: Puppeteer::Launcher::Chrome::DefaultArgs
- Inherits:
-
Object
- Object
- Puppeteer::Launcher::Chrome::DefaultArgs
- Includes:
- Enumerable
- Defined in:
- lib/puppeteer/launcher/chrome.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.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/puppeteer/launcher/chrome.rb', line 113 def initialize() chrome_arguments = [ '--disable-background-networking', '--enable-features=NetworkService,NetworkServiceInProcess', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-breakpad', '--disable-client-side-phishing-detection', '--disable-component-extensions-with-background-pages', '--disable-default-apps', '--disable-dev-shm-usage', '--disable-extensions', '--disable-features=Translate', '--disable-hang-monitor', '--disable-ipc-flooding-protection', '--disable-popup-blocking', '--disable-prompt-on-repost', '--disable-renderer-backgrounding', '--disable-sync', '--force-color-profile=srgb', '--metrics-recording-only', '--no-first-run', '--enable-automation', '--password-store=basic', '--use-mock-keychain', # TODO(sadym): remove '--enable-blink-features=IdleDetection' # once IdleDetection is turned on by default. '--enable-blink-features=IdleDetection', ] if .user_data_dir chrome_arguments << "--user-data-dir=#{chrome_arg_options.user_data_dir}" end if .devtools? chrome_arguments << '--auto-open-devtools-for-tabs' end if .headless? chrome_arguments.concat([ '--headless', '--hide-scrollbars', '--mute-audio', ]) end if .args.all? { |arg| arg.start_with?('-') } chrome_arguments << 'about:blank' end chrome_arguments.concat(.args) @chrome_arguments = chrome_arguments end |
Instance Method Details
#each(&block) ⇒ Object
168 169 170 171 172 |
# File 'lib/puppeteer/launcher/chrome.rb', line 168 def each(&block) @chrome_arguments.each do |opt| block.call(opt) end end |