puppeteer-ruby 0.0.11 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +0 -12
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/README.md +54 -1
  6. data/lib/puppeteer.rb +39 -13
  7. data/lib/puppeteer/browser.rb +22 -25
  8. data/lib/puppeteer/cdp_session.rb +3 -19
  9. data/lib/puppeteer/concurrent_ruby_utils.rb +12 -2
  10. data/lib/puppeteer/connection.rb +3 -15
  11. data/lib/puppeteer/define_async_method.rb +23 -0
  12. data/lib/puppeteer/dom_world.rb +51 -65
  13. data/lib/puppeteer/element_handle.rb +15 -44
  14. data/lib/puppeteer/emulation_manager.rb +2 -6
  15. data/lib/puppeteer/event_callbackable.rb +11 -0
  16. data/lib/puppeteer/execution_context.rb +1 -6
  17. data/lib/puppeteer/frame.rb +34 -39
  18. data/lib/puppeteer/frame_manager.rb +7 -25
  19. data/lib/puppeteer/js_handle.rb +3 -12
  20. data/lib/puppeteer/keyboard.rb +6 -27
  21. data/lib/puppeteer/launcher.rb +6 -6
  22. data/lib/puppeteer/launcher/chrome.rb +10 -8
  23. data/lib/puppeteer/mouse.rb +5 -25
  24. data/lib/puppeteer/network_manager.rb +163 -5
  25. data/lib/puppeteer/page.rb +230 -177
  26. data/lib/puppeteer/page/pdf_options.rb +166 -0
  27. data/lib/puppeteer/remote_object.rb +2 -5
  28. data/lib/puppeteer/request.rb +336 -0
  29. data/lib/puppeteer/response.rb +113 -0
  30. data/lib/puppeteer/target.rb +1 -1
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +2 -4
  34. data/lib/puppeteer/web_socket_transport.rb +8 -8
  35. data/puppeteer-ruby.gemspec +1 -1
  36. data/puppeteer-ruby.png +0 -0
  37. metadata +11 -105
  38. data/Dockerfile +0 -6
  39. data/docker-compose.yml +0 -15
  40. data/docs/Puppeteer.html +0 -2020
  41. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  42. data/docs/Puppeteer/Browser.html +0 -2258
  43. data/docs/Puppeteer/BrowserContext.html +0 -809
  44. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  45. data/docs/Puppeteer/BrowserRunner.html +0 -914
  46. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  47. data/docs/Puppeteer/CDPSession.html +0 -813
  48. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  49. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -430
  50. data/docs/Puppeteer/Connection.html +0 -964
  51. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  52. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  53. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  54. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  55. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  56. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  57. data/docs/Puppeteer/DOMWorld.html +0 -2219
  58. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  59. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  60. data/docs/Puppeteer/DebugPrint.html +0 -233
  61. data/docs/Puppeteer/Device.html +0 -470
  62. data/docs/Puppeteer/Devices.html +0 -139
  63. data/docs/Puppeteer/ElementHandle.html +0 -2542
  64. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  65. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  66. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  67. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  68. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  69. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  70. data/docs/Puppeteer/EmulationManager.html +0 -454
  71. data/docs/Puppeteer/EventCallbackable.html +0 -433
  72. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  73. data/docs/Puppeteer/ExecutionContext.html +0 -998
  74. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  75. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  76. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  77. data/docs/Puppeteer/FileChooser.html +0 -455
  78. data/docs/Puppeteer/Frame.html +0 -3813
  79. data/docs/Puppeteer/FrameManager.html +0 -2410
  80. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  81. data/docs/Puppeteer/IfPresent.html +0 -222
  82. data/docs/Puppeteer/JSHandle.html +0 -1352
  83. data/docs/Puppeteer/Keyboard.html +0 -1557
  84. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  85. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  86. data/docs/Puppeteer/Launcher.html +0 -237
  87. data/docs/Puppeteer/Launcher/Base.html +0 -385
  88. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  89. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  90. data/docs/Puppeteer/Launcher/Chrome.html +0 -669
  91. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  92. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  93. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  94. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  95. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  96. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  97. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  98. data/docs/Puppeteer/Mouse.html +0 -1095
  99. data/docs/Puppeteer/Mouse/Button.html +0 -136
  100. data/docs/Puppeteer/NetworkManager.html +0 -901
  101. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  102. data/docs/Puppeteer/Page.html +0 -5970
  103. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  104. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  105. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  106. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  107. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  108. data/docs/Puppeteer/RemoteObject.html +0 -1087
  109. data/docs/Puppeteer/Target.html +0 -1336
  110. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  111. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  112. data/docs/Puppeteer/TimeoutError.html +0 -135
  113. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  114. data/docs/Puppeteer/TouchScreen.html +0 -464
  115. data/docs/Puppeteer/Viewport.html +0 -837
  116. data/docs/Puppeteer/WaitTask.html +0 -637
  117. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  118. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  119. data/docs/Puppeteer/WebSocket.html +0 -673
  120. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  121. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  122. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  123. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  124. data/docs/_index.html +0 -816
  125. data/docs/class_list.html +0 -51
  126. data/docs/css/common.css +0 -1
  127. data/docs/css/full_list.css +0 -58
  128. data/docs/css/style.css +0 -496
  129. data/docs/file.README.html +0 -123
  130. data/docs/file_list.html +0 -56
  131. data/docs/frames.html +0 -17
  132. data/docs/index.html +0 -123
  133. data/docs/js/app.js +0 -314
  134. data/docs/js/full_list.js +0 -216
  135. data/docs/js/jquery.js +0 -4
  136. data/docs/method_list.html +0 -4091
  137. data/docs/top-level-namespace.html +0 -126
  138. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,669 +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; !Promise&lt;!Browser&gt; </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; Object </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>!Promise&lt;!<span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>&gt;</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
- <p class="tag_title">Parameters:</p>
260
- <ul class="param">
261
-
262
- <li>
263
-
264
- <span class='name'>options</span>
265
-
266
-
267
- <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="BrowserOptions.html" title="Puppeteer::Launcher::BrowserOptions (class)">BrowserOptions</a></span> & {browserWSEndpoint?: string, browserURL?: string, transport?: !<span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.ConnectionTransport})</tt>)</span>
268
-
269
-
270
- <em class="default">(defaults to: <tt>{}</tt>)</em>
271
-
272
-
273
- </li>
274
-
275
- </ul>
276
-
277
- <p class="tag_title">Returns:</p>
278
- <ul class="return">
279
-
280
- <li>
281
-
282
-
283
- <span class='type'>(<tt>!Promise&lt;!<span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>&gt;</tt>)</span>
284
-
285
-
286
-
287
- </li>
288
-
289
- </ul>
290
-
291
- </div><table class="source_code">
292
- <tr>
293
- <td>
294
- <pre class="lines">
295
-
296
-
297
- 152
298
- 153
299
- 154
300
- 155
301
- 156
302
- 157
303
- 158
304
- 159
305
- 160
306
- 161
307
- 162
308
- 163
309
- 164
310
- 165
311
- 166
312
- 167
313
- 168
314
- 169
315
- 170
316
- 171
317
- 172
318
- 173
319
- 174
320
- 175
321
- 176
322
- 177
323
- 178
324
- 179
325
- 180</pre>
326
- </td>
327
- <td>
328
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 152</span>
329
-
330
- <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>
331
- <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>
332
- <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>
333
- <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>
334
- <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>
335
-
336
- <span class='id identifier rubyid_connection'>connection</span> <span class='op'>=</span>
337
- <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>
338
- <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>
339
- <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>
340
- <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>
341
- <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>
342
- <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>
343
- <span class='kw'>else</span>
344
- <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>
345
- <span class='kw'>end</span>
346
-
347
- <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>
348
- <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>
349
-
350
- <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>
351
- <span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
352
- <span class='label'>context_ids:</span> <span class='id identifier rubyid_browser_context_ids'>browser_context_ids</span><span class='comma'>,</span>
353
- <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>
354
- <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>
355
- <span class='label'>process:</span> <span class='kw'>nil</span><span class='comma'>,</span>
356
- <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>
357
- <span class='rparen'>)</span>
358
- <span class='kw'>end</span></pre>
359
- </td>
360
- </tr>
361
- </table>
362
- </div>
363
-
364
- <div class="method_details ">
365
- <h3 class="signature " id="default_args-instance_method">
366
-
367
- #<strong>default_args</strong>(options = nil) &#x21d2; <tt>Object</tt>
368
-
369
-
370
-
371
-
372
-
373
- </h3><table class="source_code">
374
- <tr>
375
- <td>
376
- <pre class="lines">
377
-
378
-
379
- 142
380
- 143
381
- 144
382
- 145
383
- 146
384
- 147
385
- 148</pre>
386
- </td>
387
- <td>
388
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 142</span>
389
-
390
- <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>
391
- <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>
392
- <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>
393
- <span class='kw'>else</span>
394
- <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>
395
- <span class='kw'>end</span>
396
- <span class='kw'>end</span></pre>
397
- </td>
398
- </tr>
399
- </table>
400
- </div>
401
-
402
- <div class="method_details ">
403
- <h3 class="signature " id="executable_path-instance_method">
404
-
405
- #<strong>executable_path</strong> &#x21d2; <tt>string</tt>
406
-
407
-
408
-
409
-
410
-
411
- </h3><div class="docstring">
412
- <div class="discussion">
413
-
414
-
415
- </div>
416
- </div>
417
- <div class="tags">
418
-
419
- <p class="tag_title">Returns:</p>
420
- <ul class="return">
421
-
422
- <li>
423
-
424
-
425
- <span class='type'>(<tt>string</tt>)</span>
426
-
427
-
428
-
429
- </li>
430
-
431
- </ul>
432
-
433
- </div><table class="source_code">
434
- <tr>
435
- <td>
436
- <pre class="lines">
437
-
438
-
439
- 203
440
- 204
441
- 205</pre>
442
- </td>
443
- <td>
444
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 203</span>
445
-
446
- <span class='kw'>def</span> <span class='id identifier rubyid_executable_path'>executable_path</span>
447
- <span class='id identifier rubyid_resolve_executable_path'>resolve_executable_path</span>
448
- <span class='kw'>end</span></pre>
449
- </td>
450
- </tr>
451
- </table>
452
- </div>
453
-
454
- <div class="method_details ">
455
- <h3 class="signature " id="launch-instance_method">
456
-
457
- #<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>
458
-
459
-
460
-
461
-
462
-
463
- </h3><div class="docstring">
464
- <div class="discussion">
465
-
466
-
467
- </div>
468
- </div>
469
- <div class="tags">
470
- <p class="tag_title">Parameters:</p>
471
- <ul class="param">
472
-
473
- <li>
474
-
475
- <span class='name'>options</span>
476
-
477
-
478
- <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>
479
-
480
-
481
- <em class="default">(defaults to: <tt>{}</tt>)</em>
482
-
483
-
484
- </li>
485
-
486
- </ul>
487
-
488
- <p class="tag_title">Returns:</p>
489
- <ul class="return">
490
-
491
- <li>
492
-
493
-
494
- <span class='type'>(<tt>!Promise&lt;!<span class='object_link'><a href="../Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>&gt;</tt>)</span>
495
-
496
-
497
-
498
- </li>
499
-
500
- </ul>
501
-
502
- </div><table class="source_code">
503
- <tr>
504
- <td>
505
- <pre class="lines">
506
-
507
-
508
- 8
509
- 9
510
- 10
511
- 11
512
- 12
513
- 13
514
- 14
515
- 15
516
- 16
517
- 17
518
- 18
519
- 19
520
- 20
521
- 21
522
- 22
523
- 23
524
- 24
525
- 25
526
- 26
527
- 27
528
- 28
529
- 29
530
- 30
531
- 31
532
- 32
533
- 33
534
- 34
535
- 35
536
- 36
537
- 37
538
- 38
539
- 39
540
- 40
541
- 41
542
- 42
543
- 43
544
- 44
545
- 45
546
- 46
547
- 47
548
- 48
549
- 49
550
- 50
551
- 51
552
- 52
553
- 53
554
- 54
555
- 55
556
- 56
557
- 57
558
- 58
559
- 59
560
- 60
561
- 61
562
- 62
563
- 63
564
- 64
565
- 65
566
- 66
567
- 67
568
- 68
569
- 69
570
- 70
571
- 71
572
- 72
573
- 73
574
- 74
575
- 75
576
- 76
577
- 77</pre>
578
- </td>
579
- <td>
580
- <pre class="code"><span class="info file"># File 'lib/puppeteer/launcher/chrome.rb', line 8</span>
581
-
582
- <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>
583
- <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>
584
- <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>
585
- <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>
586
-
587
- <span class='id identifier rubyid_chrome_arguments'>chrome_arguments</span> <span class='op'>=</span>
588
- <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>
589
- <span class='id identifier rubyid_default_args'>default_args</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
590
- <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>
591
- <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>
592
- <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>
593
- <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
594
- <span class='kw'>else</span>
595
- <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>
596
- <span class='kw'>end</span>
597
-
598
- <span class='comment'>#
599
- </span> <span class='comment'># let temporaryUserDataDir = null;
600
- </span>
601
- <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>
602
- <span class='kw'>if</span> <span class='ivar'>@launch_options</span><span class='period'>.</span><span class='id identifier rubyid_pipe?'>pipe?</span>
603
- <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>
604
- <span class='kw'>else</span>
605
- <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>
606
- <span class='kw'>end</span>
607
- <span class='kw'>end</span>
608
-
609
- <span class='id identifier rubyid_temporary_user_data_dir'>temporary_user_data_dir</span> <span class='op'>=</span> <span class='kw'>nil</span>
610
- <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>
611
- <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>
612
- <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>
613
- <span class='kw'>end</span>
614
-
615
- <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>
616
- <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>
617
- <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>
618
- <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span><span class='lparen'>(</span>
619
- <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>
620
- <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>
621
- <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>
622
- <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>
623
- <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>
624
- <span class='label'>pipe:</span> <span class='id identifier rubyid_use_pipe'>use_pipe</span><span class='comma'>,</span>
625
- <span class='rparen'>)</span>
626
-
627
- <span class='kw'>begin</span>
628
- <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>
629
- <span class='label'>use_pipe:</span> <span class='id identifier rubyid_use_pipe'>use_pipe</span><span class='comma'>,</span>
630
- <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>
631
- <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>
632
- <span class='label'>preferred_revision:</span> <span class='ivar'>@preferred_revision</span><span class='comma'>,</span>
633
- <span class='rparen'>)</span>
634
-
635
- <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>
636
- <span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
637
- <span class='label'>context_ids:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
638
- <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>
639
- <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>
640
- <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>
641
- <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>
642
- <span class='rparen'>)</span>
643
-
644
- <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>
645
-
646
- <span class='id identifier rubyid_browser'>browser</span>
647
- <span class='kw'>rescue</span>
648
- <span class='id identifier rubyid_runner'>runner</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span>
649
- <span class='id identifier rubyid_raise'>raise</span>
650
- <span class='kw'>end</span>
651
- <span class='kw'>end</span></pre>
652
- </td>
653
- </tr>
654
- </table>
655
- </div>
656
-
657
- </div>
658
-
659
- </div>
660
-
661
- <div id="footer">
662
- Generated on Sat Jun 20 17:15:08 2020 by
663
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
664
- 0.9.24 (ruby-2.6.3).
665
- </div>
666
-
667
- </div>
668
- </body>
669
- </html>