puppeteer-ruby 0.0.13 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -14
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/.rubocop.yml +39 -3
  6. data/README.md +54 -1
  7. data/lib/puppeteer.rb +10 -2
  8. data/lib/puppeteer/browser.rb +53 -34
  9. data/lib/puppeteer/browser_context.rb +35 -5
  10. data/lib/puppeteer/cdp_session.rb +3 -19
  11. data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
  12. data/lib/puppeteer/connection.rb +9 -16
  13. data/lib/puppeteer/debug_print.rb +1 -1
  14. data/lib/puppeteer/define_async_method.rb +23 -0
  15. data/lib/puppeteer/dom_world.rb +84 -73
  16. data/lib/puppeteer/element_handle.rb +46 -63
  17. data/lib/puppeteer/emulation_manager.rb +2 -6
  18. data/lib/puppeteer/env.rb +18 -0
  19. data/lib/puppeteer/execution_context.rb +1 -6
  20. data/lib/puppeteer/frame.rb +46 -46
  21. data/lib/puppeteer/frame_manager.rb +7 -25
  22. data/lib/puppeteer/js_handle.rb +39 -38
  23. data/lib/puppeteer/keyboard.rb +9 -29
  24. data/lib/puppeteer/mouse.rb +20 -24
  25. data/lib/puppeteer/network_manager.rb +163 -5
  26. data/lib/puppeteer/page.rb +221 -181
  27. data/lib/puppeteer/page/pdf_options.rb +166 -0
  28. data/lib/puppeteer/remote_object.rb +18 -5
  29. data/lib/puppeteer/request.rb +330 -0
  30. data/lib/puppeteer/response.rb +113 -0
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +3 -5
  34. data/lib/puppeteer/web_socket.rb +7 -0
  35. data/puppeteer-ruby.gemspec +2 -1
  36. metadata +25 -103
  37. data/docs/Puppeteer.html +0 -2338
  38. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  39. data/docs/Puppeteer/Browser.html +0 -2258
  40. data/docs/Puppeteer/BrowserContext.html +0 -809
  41. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  42. data/docs/Puppeteer/BrowserRunner.html +0 -914
  43. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  44. data/docs/Puppeteer/CDPSession.html +0 -813
  45. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  46. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
  47. data/docs/Puppeteer/Connection.html +0 -964
  48. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  49. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  50. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  51. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  52. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  53. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  54. data/docs/Puppeteer/DOMWorld.html +0 -2293
  55. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  56. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  57. data/docs/Puppeteer/DebugPrint.html +0 -233
  58. data/docs/Puppeteer/Device.html +0 -470
  59. data/docs/Puppeteer/Devices.html +0 -139
  60. data/docs/Puppeteer/ElementHandle.html +0 -2542
  61. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  62. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  63. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  64. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  65. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  66. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  67. data/docs/Puppeteer/EmulationManager.html +0 -454
  68. data/docs/Puppeteer/EventCallbackable.html +0 -499
  69. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  70. data/docs/Puppeteer/ExecutionContext.html +0 -998
  71. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  72. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  73. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  74. data/docs/Puppeteer/FileChooser.html +0 -455
  75. data/docs/Puppeteer/Frame.html +0 -3835
  76. data/docs/Puppeteer/FrameManager.html +0 -2410
  77. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  78. data/docs/Puppeteer/IfPresent.html +0 -222
  79. data/docs/Puppeteer/JSHandle.html +0 -1352
  80. data/docs/Puppeteer/Keyboard.html +0 -1557
  81. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  82. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  83. data/docs/Puppeteer/Launcher.html +0 -237
  84. data/docs/Puppeteer/Launcher/Base.html +0 -385
  85. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  86. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  87. data/docs/Puppeteer/Launcher/Chrome.html +0 -674
  88. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  89. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  90. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  91. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  92. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  93. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  94. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  95. data/docs/Puppeteer/Mouse.html +0 -1095
  96. data/docs/Puppeteer/Mouse/Button.html +0 -136
  97. data/docs/Puppeteer/NetworkManager.html +0 -901
  98. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  99. data/docs/Puppeteer/Page.html +0 -6173
  100. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  101. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  102. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  103. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  104. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  105. data/docs/Puppeteer/RemoteObject.html +0 -1087
  106. data/docs/Puppeteer/Target.html +0 -1336
  107. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  108. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  109. data/docs/Puppeteer/TimeoutError.html +0 -135
  110. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  111. data/docs/Puppeteer/TouchScreen.html +0 -464
  112. data/docs/Puppeteer/Viewport.html +0 -837
  113. data/docs/Puppeteer/WaitTask.html +0 -637
  114. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  115. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  116. data/docs/Puppeteer/WebSocket.html +0 -673
  117. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  118. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  119. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  120. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  121. data/docs/_index.html +0 -816
  122. data/docs/class_list.html +0 -51
  123. data/docs/css/common.css +0 -1
  124. data/docs/css/full_list.css +0 -58
  125. data/docs/css/style.css +0 -496
  126. data/docs/file.README.html +0 -125
  127. data/docs/file_list.html +0 -56
  128. data/docs/frames.html +0 -17
  129. data/docs/index.html +0 -125
  130. data/docs/js/app.js +0 -314
  131. data/docs/js/full_list.js +0 -216
  132. data/docs/js/jquery.js +0 -4
  133. data/docs/method_list.html +0 -4123
  134. data/docs/top-level-namespace.html +0 -126
  135. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,674 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- Class: Puppeteer::Launcher::Chrome
8
-
9
- &mdash; Documentation by YARD 0.9.24
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
-
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
-
17
- <script type="text/javascript">
18
- pathId = "Puppeteer::Launcher::Chrome";
19
- relpath = '../../';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="../../class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="../../_index.html">Index (C)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Launcher.html" title="Puppeteer::Launcher (module)">Launcher</a></span></span>
41
- &raquo;
42
- <span class="title">Chrome</span>
43
-
44
- </div>
45
-
46
- <div id="search">
47
-
48
- <a class="full_list_link" id="class_list_link"
49
- href="../../class_list.html">
50
-
51
- <svg width="24" height="24">
52
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
- </svg>
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <div id="content"><h1>Class: Puppeteer::Launcher::Chrome
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName"><span class='object_link'><a href="Base.html" title="Puppeteer::Launcher::Base (class)">Base</a></span></span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next"><span class='object_link'><a href="Base.html" title="Puppeteer::Launcher::Base (class)">Base</a></span></li>
78
-
79
- <li class="next">Puppeteer::Launcher::Chrome</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/puppeteer/launcher/chrome.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
- <h2>Defined Under Namespace</h2>
105
- <p class="children">
106
-
107
-
108
-
109
-
110
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Chrome/DefaultArgs.html" title="Puppeteer::Launcher::Chrome::DefaultArgs (class)">DefaultArgs</a></span>
111
-
112
-
113
- </p>
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
- <h2>
123
- Instance Method Summary
124
- <small><a href="#" class="summary_toggle">collapse</a></small>
125
- </h2>
126
-
127
- <ul class="summary">
128
-
129
- <li class="public ">
130
- <span class="summary_signature">
131
-
132
- <a href="#connect-instance_method" title="#connect (instance method)">#<strong>connect</strong>(options = {}) &#x21d2; Puppeteer::Browser </a>
133
-
134
-
135
-
136
- </span>
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
- <span class="summary_desc"><div class='inline'></div></span>
147
-
148
- </li>
149
-
150
-
151
- <li class="public ">
152
- <span class="summary_signature">
153
-
154
- <a href="#default_args-instance_method" title="#default_args (instance method)">#<strong>default_args</strong>(options = nil) &#x21d2; DefaultArgs </a>
155
-
156
-
157
-
158
- </span>
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
- <span class="summary_desc"><div class='inline'></div></span>
169
-
170
- </li>
171
-
172
-
173
- <li class="public ">
174
- <span class="summary_signature">
175
-
176
- <a href="#executable_path-instance_method" title="#executable_path (instance method)">#<strong>executable_path</strong> &#x21d2; string </a>
177
-
178
-
179
-
180
- </span>
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
- <span class="summary_desc"><div class='inline'></div></span>
191
-
192
- </li>
193
-
194
-
195
- <li class="public ">
196
- <span class="summary_signature">
197
-
198
- <a href="#launch-instance_method" title="#launch (instance method)">#<strong>launch</strong>(options = {}) &#x21d2; !Promise&lt;!Browser&gt; </a>
199
-
200
-
201
-
202
- </span>
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
- <span class="summary_desc"><div class='inline'></div></span>
213
-
214
- </li>
215
-
216
-
217
- </ul>
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Puppeteer::Launcher::Base (class)">Base</a></span></h3>
230
- <p class="inherited"><span class='object_link'><a href="Base.html#initialize-instance_method" title="Puppeteer::Launcher::Base#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Base.html#resolve_executable_path-instance_method" title="Puppeteer::Launcher::Base#resolve_executable_path (method)">#resolve_executable_path</a></span></p>
231
- <div id="constructor_details" class="method_details_list">
232
- <h2>Constructor Details</h2>
233
-
234
- <p class="notice">This class inherits a constructor from <span class='object_link'><a href="Base.html#initialize-instance_method" title="Puppeteer::Launcher::Base#initialize (method)">Puppeteer::Launcher::Base</a></span></p>
235
-
236
- </div>
237
-
238
-
239
- <div id="instance_method_details" class="method_details_list">
240
- <h2>Instance Method Details</h2>
241
-
242
-
243
- <div class="method_details first">
244
- <h3 class="signature first" id="connect-instance_method">
245
-
246
- #<strong>connect</strong>(options = {}) &#x21d2; <tt><span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Puppeteer::Browser</a></span></tt>
247
-
248
-
249
-
250
-
251
-
252
- </h3><div class="docstring">
253
- <div class="discussion">
254
-
255
-
256
- </div>
257
- </div>
258
- <div class="tags">
259
-
260
- <p class="tag_title">Returns:</p>
261
- <ul class="return">
262
-
263
- <li>
264
-
265
-
266
- <span class='type'>(<tt><span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Puppeteer::Browser</a></span></tt>)</span>
267
-
268
-
269
-
270
- </li>
271
-
272
- </ul>
273
-
274
- </div><table class="source_code">
275
- <tr>
276
- <td>
277
- <pre class="lines">
278
-
279
-
280
- 152
281
- 153
282
- 154
283
- 155
284
- 156
285
- 157
286
- 158
287
- 159
288
- 160
289
- 161
290
- 162
291
- 163
292
- 164
293
- 165
294
- 166
295
- 167
296
- 168
297
- 169
298
- 170
299
- 171
300
- 172
301
- 173
302
- 174
303
- 175
304
- 176
305
- 177
306
- 178
307
- 179
308
- 180</pre>
309
- </td>
310
- <td>
311
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 152</span>
312
-
313
- <span class='kw'>def</span> <span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
314
- <span class='ivar'>@browser_options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="BrowserOptions.html" title="Puppeteer::Launcher::BrowserOptions (class)">BrowserOptions</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserOptions.html#initialize-instance_method" title="Puppeteer::Launcher::BrowserOptions#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
315
- <span class='id identifier rubyid_browser_ws_endpoint'>browser_ws_endpoint</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:browser_ws_endpoint</span><span class='rbracket'>]</span>
316
- <span class='id identifier rubyid_browser_url'>browser_url</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:browser_url</span><span class='rbracket'>]</span>
317
- <span class='id identifier rubyid_transport'>transport</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:transport</span><span class='rbracket'>]</span>
318
-
319
- <span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span>
320
- <span class='kw'>if</span> <span class='id identifier rubyid_browser_ws_endpoint'>browser_ws_endpoint</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_browser_url'>browser_url</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_transport'>transport</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
321
- <span class='id identifier rubyid_connect_with_browser_ws_endpoint'>connect_with_browser_ws_endpoint</span><span class='lparen'>(</span><span class='id identifier rubyid_browser_ws_endpoint'>browser_ws_endpoint</span><span class='rparen'>)</span>
322
- <span class='kw'>elsif</span> <span class='id identifier rubyid_browser_ws_endpoint'>browser_ws_endpoint</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_browser_url'>browser_url</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_transport'>transport</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
323
- <span class='id identifier rubyid_connect_with_browser_url'>connect_with_browser_url</span><span class='lparen'>(</span><span class='id identifier rubyid_browser_url'>browser_url</span><span class='rparen'>)</span>
324
- <span class='kw'>elsif</span> <span class='id identifier rubyid_browser_ws_endpoint'>browser_ws_endpoint</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_browser_url'>browser_url</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_transport'>transport</span>
325
- <span class='id identifier rubyid_connect_with_transport'>connect_with_transport</span><span class='lparen'>(</span><span class='id identifier rubyid_transport'>transport</span><span class='rparen'>)</span>
326
- <span class='kw'>else</span>
327
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Exactly one of browserWSEndpoint, browserURL or transport must be passed to puppeteer.connect</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
328
- <span class='kw'>end</span>
329
-
330
- <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Target.getBrowserContexts</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
331
- <span class='id identifier rubyid_browser_context_ids'>browser_context_ids</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>browserContextIds</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
332
-
333
- <span class='const'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="../Browser.html#create-class_method" title="Puppeteer::Browser.create (method)">create</a></span></span><span class='lparen'>(</span>
334
- <span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
335
- <span class='label'>context_ids:</span> <span class='id identifier rubyid_browser_context_ids'>browser_context_ids</span><span class='comma'>,</span>
336
- <span class='label'>ignore_https_errors:</span> <span class='ivar'>@browser_options</span><span class='period'>.</span><span class='id identifier rubyid_ignore_https_errors?'>ignore_https_errors?</span><span class='comma'>,</span>
337
- <span class='label'>default_viewport:</span> <span class='ivar'>@browser_options</span><span class='period'>.</span><span class='id identifier rubyid_default_viewport'>default_viewport</span><span class='comma'>,</span>
338
- <span class='label'>process:</span> <span class='kw'>nil</span><span class='comma'>,</span>
339
- <span class='label'>close_callback:</span> <span class='tlambda'>-&gt;</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_connection'>connection</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Browser.close</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
340
- <span class='rparen'>)</span>
341
- <span class='kw'>end</span></pre>
342
- </td>
343
- </tr>
344
- </table>
345
- </div>
346
-
347
- <div class="method_details ">
348
- <h3 class="signature " id="default_args-instance_method">
349
-
350
- #<strong>default_args</strong>(options = nil) &#x21d2; <tt><span class='object_link'><a href="Chrome/DefaultArgs.html" title="Puppeteer::Launcher::Chrome::DefaultArgs (class)">DefaultArgs</a></span></tt>
351
-
352
-
353
-
354
-
355
-
356
- </h3><div class="docstring">
357
- <div class="discussion">
358
-
359
-
360
- </div>
361
- </div>
362
- <div class="tags">
363
-
364
- <p class="tag_title">Returns:</p>
365
- <ul class="return">
366
-
367
- <li>
368
-
369
-
370
- <span class='type'>(<tt><span class='object_link'><a href="Chrome/DefaultArgs.html" title="Puppeteer::Launcher::Chrome::DefaultArgs (class)">DefaultArgs</a></span></tt>)</span>
371
-
372
-
373
-
374
- </li>
375
-
376
- </ul>
377
-
378
- </div><table class="source_code">
379
- <tr>
380
- <td>
381
- <pre class="lines">
382
-
383
-
384
- 143
385
- 144
386
- 145
387
- 146
388
- 147
389
- 148
390
- 149</pre>
391
- </td>
392
- <td>
393
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 143</span>
394
-
395
- <span class='kw'>def</span> <span class='id identifier rubyid_default_args'>default_args</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
396
- <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
397
- <span class='ivar'>@default_args</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Chrome/DefaultArgs.html" title="Puppeteer::Launcher::Chrome::DefaultArgs (class)">DefaultArgs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Chrome/DefaultArgs.html#initialize-instance_method" title="Puppeteer::Launcher::Chrome::DefaultArgs#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@chrome_arg_options</span><span class='rparen'>)</span>
398
- <span class='kw'>else</span>
399
- <span class='const'><span class='object_link'><a href="Chrome/DefaultArgs.html" title="Puppeteer::Launcher::Chrome::DefaultArgs (class)">DefaultArgs</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Chrome/DefaultArgs.html#initialize-instance_method" title="Puppeteer::Launcher::Chrome::DefaultArgs#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ChromeArgOptions.html" title="Puppeteer::Launcher::ChromeArgOptions (class)">ChromeArgOptions</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ChromeArgOptions.html#initialize-instance_method" title="Puppeteer::Launcher::ChromeArgOptions#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span><span class='rparen'>)</span>
400
- <span class='kw'>end</span>
401
- <span class='kw'>end</span></pre>
402
- </td>
403
- </tr>
404
- </table>
405
- </div>
406
-
407
- <div class="method_details ">
408
- <h3 class="signature " id="executable_path-instance_method">
409
-
410
- #<strong>executable_path</strong> &#x21d2; <tt>string</tt>
411
-
412
-
413
-
414
-
415
-
416
- </h3><div class="docstring">
417
- <div class="discussion">
418
-
419
-
420
- </div>
421
- </div>
422
- <div class="tags">
423
-
424
- <p class="tag_title">Returns:</p>
425
- <ul class="return">
426
-
427
- <li>
428
-
429
-
430
- <span class='type'>(<tt>string</tt>)</span>
431
-
432
-
433
-
434
- </li>
435
-
436
- </ul>
437
-
438
- </div><table class="source_code">
439
- <tr>
440
- <td>
441
- <pre class="lines">
442
-
443
-
444
- 205
445
- 206
446
- 207</pre>
447
- </td>
448
- <td>
449
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 205</span>
450
-
451
- <span class='kw'>def</span> <span class='id identifier rubyid_executable_path'>executable_path</span>
452
- <span class='id identifier rubyid_resolve_executable_path'>resolve_executable_path</span>
453
- <span class='kw'>end</span></pre>
454
- </td>
455
- </tr>
456
- </table>
457
- </div>
458
-
459
- <div class="method_details ">
460
- <h3 class="signature " id="launch-instance_method">
461
-
462
- #<strong>launch</strong>(options = {}) &#x21d2; <tt>!Promise&lt;!<span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>&gt;</tt>
463
-
464
-
465
-
466
-
467
-
468
- </h3><div class="docstring">
469
- <div class="discussion">
470
-
471
-
472
- </div>
473
- </div>
474
- <div class="tags">
475
- <p class="tag_title">Parameters:</p>
476
- <ul class="param">
477
-
478
- <li>
479
-
480
- <span class='name'>options</span>
481
-
482
-
483
- <span class='type'>(<tt>!(<span class='object_link'><a href="../Launcher.html" title="Puppeteer::Launcher (module)">Launcher</a></span>.<span class='object_link'><a href="LaunchOptions.html" title="Puppeteer::Launcher::LaunchOptions (class)">LaunchOptions</a></span> & <span class='object_link'><a href="../Launcher.html" title="Puppeteer::Launcher (module)">Launcher</a></span>.<span class='object_link'><a href="ChromeArgOptions.html" title="Puppeteer::Launcher::ChromeArgOptions (class)">ChromeArgOptions</a></span> & <span class='object_link'><a href="../Launcher.html" title="Puppeteer::Launcher (module)">Launcher</a></span>.<span class='object_link'><a href="BrowserOptions.html" title="Puppeteer::Launcher::BrowserOptions (class)">BrowserOptions</a></span>)=</tt>)</span>
484
-
485
-
486
- <em class="default">(defaults to: <tt>{}</tt>)</em>
487
-
488
-
489
- </li>
490
-
491
- </ul>
492
-
493
- <p class="tag_title">Returns:</p>
494
- <ul class="return">
495
-
496
- <li>
497
-
498
-
499
- <span class='type'>(<tt>!Promise&lt;!<span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>&gt;</tt>)</span>
500
-
501
-
502
-
503
- </li>
504
-
505
- </ul>
506
-
507
- </div><table class="source_code">
508
- <tr>
509
- <td>
510
- <pre class="lines">
511
-
512
-
513
- 8
514
- 9
515
- 10
516
- 11
517
- 12
518
- 13
519
- 14
520
- 15
521
- 16
522
- 17
523
- 18
524
- 19
525
- 20
526
- 21
527
- 22
528
- 23
529
- 24
530
- 25
531
- 26
532
- 27
533
- 28
534
- 29
535
- 30
536
- 31
537
- 32
538
- 33
539
- 34
540
- 35
541
- 36
542
- 37
543
- 38
544
- 39
545
- 40
546
- 41
547
- 42
548
- 43
549
- 44
550
- 45
551
- 46
552
- 47
553
- 48
554
- 49
555
- 50
556
- 51
557
- 52
558
- 53
559
- 54
560
- 55
561
- 56
562
- 57
563
- 58
564
- 59
565
- 60
566
- 61
567
- 62
568
- 63
569
- 64
570
- 65
571
- 66
572
- 67
573
- 68
574
- 69
575
- 70
576
- 71
577
- 72
578
- 73
579
- 74
580
- 75
581
- 76
582
- 77</pre>
583
- </td>
584
- <td>
585
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 8</span>
586
-
587
- <span class='kw'>def</span> <span class='id identifier rubyid_launch'>launch</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
588
- <span class='ivar'>@chrome_arg_options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="ChromeArgOptions.html" title="Puppeteer::Launcher::ChromeArgOptions (class)">ChromeArgOptions</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ChromeArgOptions.html#initialize-instance_method" title="Puppeteer::Launcher::ChromeArgOptions#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
589
- <span class='ivar'>@launch_options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="LaunchOptions.html" title="Puppeteer::Launcher::LaunchOptions (class)">LaunchOptions</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="LaunchOptions.html#initialize-instance_method" title="Puppeteer::Launcher::LaunchOptions#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
590
- <span class='ivar'>@browser_options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="BrowserOptions.html" title="Puppeteer::Launcher::BrowserOptions (class)">BrowserOptions</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserOptions.html#initialize-instance_method" title="Puppeteer::Launcher::BrowserOptions#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
591
-
592
- <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span> <span class='op'>=</span>
593
- <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_ignore_default_args'>ignore_default_args</span>
594
- <span class='id identifier rubyid_default_args'>default_args</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
595
- <span class='kw'>elsif</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_ignore_default_args'>ignore_default_args</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Enumerable</span><span class='rparen'>)</span>
596
- <span class='id identifier rubyid_default_args'>default_args</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span>
597
- <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_ignore_default_args'>ignore_default_args</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
598
- <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
599
- <span class='kw'>else</span>
600
- <span class='ivar'>@chrome_arg_options</span><span class='period'>.</span><span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
601
- <span class='kw'>end</span>
602
-
603
- <span class='comment'>#
604
- </span> <span class='comment'># let temporaryUserDataDir = null;
605
- </span>
606
- <span class='kw'>if</span> <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span><span class='period'>.</span><span class='id identifier rubyid_none?'>none?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--remote-debugging-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
607
- <span class='kw'>if</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_pipe?'>pipe?</span>
608
- <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--remote-debugging-pipe</span><span class='tstring_end'>&#39;</span></span>
609
- <span class='kw'>else</span>
610
- <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--remote-debugging-port=0</span><span class='tstring_end'>&#39;</span></span>
611
- <span class='kw'>end</span>
612
- <span class='kw'>end</span>
613
-
614
- <span class='id identifier rubyid_temporary_user_data_dir'>temporary_user_data_dir</span> <span class='op'>=</span> <span class='kw'>nil</span>
615
- <span class='kw'>if</span> <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span><span class='period'>.</span><span class='id identifier rubyid_none?'>none?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_arg'>arg</span><span class='op'>|</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--user-data-dir</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='rbrace'>}</span>
616
- <span class='id identifier rubyid_temporary_user_data_dir'>temporary_user_data_dir</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>puppeteer_dev_profile-</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
617
- <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--user-data-dir=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_temporary_user_data_dir'>temporary_user_data_dir</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
618
- <span class='kw'>end</span>
619
-
620
- <span class='id identifier rubyid_chrome_executable'>chrome_executable</span> <span class='op'>=</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_executable_path'>executable_path</span> <span class='op'>||</span> <span class='id identifier rubyid_resolve_executable_path'>resolve_executable_path</span>
621
- <span class='id identifier rubyid_use_pipe'>use_pipe</span> <span class='op'>=</span> <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>--remote-debugging-pipe</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
622
- <span class='id identifier rubyid_runner'>runner</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../BrowserRunner.html" title="Puppeteer::BrowserRunner (class)">BrowserRunner</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../BrowserRunner.html#initialize-instance_method" title="Puppeteer::BrowserRunner#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_chrome_executable'>chrome_executable</span><span class='comma'>,</span> <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_temporary_user_data_dir'>temporary_user_data_dir</span><span class='rparen'>)</span>
623
- <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span>
624
- <span class='label'>handle_SIGHUP:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_handle_SIGHUP?'>handle_SIGHUP?</span><span class='comma'>,</span>
625
- <span class='label'>handle_SIGTERM:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_handle_SIGTERM?'>handle_SIGTERM?</span><span class='comma'>,</span>
626
- <span class='label'>handle_SIGINT:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_handle_SIGINT?'>handle_SIGINT?</span><span class='comma'>,</span>
627
- <span class='label'>dumpio:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_dumpio?'>dumpio?</span><span class='comma'>,</span>
628
- <span class='label'>env:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_env'>env</span><span class='comma'>,</span>
629
- <span class='label'>pipe:</span> <span class='id identifier rubyid_use_pipe'>use_pipe</span><span class='comma'>,</span>
630
- <span class='rparen'>)</span>
631
-
632
- <span class='kw'>begin</span>
633
- <span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span> <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_setup_connection'>setup_connection</span><span class='lparen'>(</span>
634
- <span class='label'>use_pipe:</span> <span class='id identifier rubyid_use_pipe'>use_pipe</span><span class='comma'>,</span>
635
- <span class='label'>timeout:</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span><span class='comma'>,</span>
636
- <span class='label'>slow_mo:</span> <span class='ivar'>@browser_options</span><span class='period'>.</span><span class='id identifier rubyid_slow_mo'>slow_mo</span><span class='comma'>,</span>
637
- <span class='label'>preferred_revision:</span> <span class='ivar'>@preferred_revision</span><span class='comma'>,</span>
638
- <span class='rparen'>)</span>
639
-
640
- <span class='id identifier rubyid_browser'>browser</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create'><span class='object_link'><a href="../Browser.html#create-class_method" title="Puppeteer::Browser.create (method)">create</a></span></span><span class='lparen'>(</span>
641
- <span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
642
- <span class='label'>context_ids:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
643
- <span class='label'>ignore_https_errors:</span> <span class='ivar'>@browser_options</span><span class='period'>.</span><span class='id identifier rubyid_ignore_https_errors?'>ignore_https_errors?</span><span class='comma'>,</span>
644
- <span class='label'>default_viewport:</span> <span class='ivar'>@browser_options</span><span class='period'>.</span><span class='id identifier rubyid_default_viewport'>default_viewport</span><span class='comma'>,</span>
645
- <span class='label'>process:</span> <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_proc'>proc</span><span class='comma'>,</span>
646
- <span class='label'>close_callback:</span> <span class='tlambda'>-&gt;</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span> <span class='rbrace'>}</span><span class='comma'>,</span>
647
- <span class='rparen'>)</span>
648
-
649
- <span class='id identifier rubyid_browser'>browser</span><span class='period'>.</span><span class='id identifier rubyid_wait_for_target'>wait_for_target</span><span class='lparen'>(</span><span class='label'>predicate:</span> <span class='tlambda'>-&gt;</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>page</span><span class='tstring_end'>&#39;</span></span> <span class='rbrace'>}</span><span class='rparen'>)</span>
650
-
651
- <span class='id identifier rubyid_browser'>browser</span>
652
- <span class='kw'>rescue</span>
653
- <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span>
654
- <span class='id identifier rubyid_raise'>raise</span>
655
- <span class='kw'>end</span>
656
- <span class='kw'>end</span></pre>
657
- </td>
658
- </tr>
659
- </table>
660
- </div>
661
-
662
- </div>
663
-
664
- </div>
665
-
666
- <div id="footer">
667
- Generated on Wed Jun 24 03:08:01 2020 by
668
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
669
- 0.9.24 (ruby-2.6.3).
670
- </div>
671
-
672
- </div>
673
- </body>
674
- </html>