puppeteer-ruby 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +30 -0
  3. data/.rubocop.yml +4 -5
  4. data/docs/Puppeteer.html +2010 -0
  5. data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
  6. data/docs/Puppeteer/Browser.html +2150 -0
  7. data/docs/Puppeteer/BrowserContext.html +809 -0
  8. data/docs/Puppeteer/BrowserFetcher.html +214 -0
  9. data/docs/Puppeteer/BrowserRunner.html +914 -0
  10. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
  11. data/docs/Puppeteer/CDPSession.html +784 -0
  12. data/docs/Puppeteer/CDPSession/Error.html +124 -0
  13. data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
  14. data/docs/Puppeteer/Connection.html +960 -0
  15. data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
  16. data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
  17. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
  18. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
  19. data/docs/Puppeteer/ConsoleMessage.html +565 -0
  20. data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
  21. data/docs/Puppeteer/DOMWorld.html +1580 -0
  22. data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
  23. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
  24. data/docs/Puppeteer/DebugPrint.html +233 -0
  25. data/docs/Puppeteer/Device.html +470 -0
  26. data/docs/Puppeteer/Devices.html +139 -0
  27. data/docs/Puppeteer/ElementHandle.html +1603 -0
  28. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
  29. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
  30. data/docs/Puppeteer/ElementHandle/Point.html +481 -0
  31. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
  32. data/docs/Puppeteer/EmulationManager.html +454 -0
  33. data/docs/Puppeteer/EventCallbackable.html +433 -0
  34. data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
  35. data/docs/Puppeteer/ExecutionContext.html +772 -0
  36. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
  37. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
  38. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
  39. data/docs/Puppeteer/Frame.html +3625 -0
  40. data/docs/Puppeteer/FrameManager.html +2414 -0
  41. data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
  42. data/docs/Puppeteer/IfPresent.html +222 -0
  43. data/docs/Puppeteer/JSHandle.html +1352 -0
  44. data/docs/Puppeteer/Keyboard.html +1557 -0
  45. data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
  46. data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
  47. data/docs/Puppeteer/Launcher.html +237 -0
  48. data/docs/Puppeteer/Launcher/Base.html +385 -0
  49. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
  50. data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
  51. data/docs/Puppeteer/Launcher/Chrome.html +628 -0
  52. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
  53. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
  54. data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
  55. data/docs/Puppeteer/LifecycleWatcher.html +834 -0
  56. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
  57. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
  58. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
  59. data/docs/Puppeteer/Mouse.html +1105 -0
  60. data/docs/Puppeteer/Mouse/Button.html +136 -0
  61. data/docs/Puppeteer/NetworkManager.html +901 -0
  62. data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
  63. data/docs/Puppeteer/Page.html +5426 -0
  64. data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
  65. data/docs/Puppeteer/Page/ScriptTag.html +555 -0
  66. data/docs/Puppeteer/Page/StyleTag.html +448 -0
  67. data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
  68. data/docs/Puppeteer/RemoteObject.html +951 -0
  69. data/docs/Puppeteer/Target.html +1384 -0
  70. data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
  71. data/docs/Puppeteer/Target/TargetInfo.html +729 -0
  72. data/docs/Puppeteer/TimeoutError.html +135 -0
  73. data/docs/Puppeteer/TimeoutSettings.html +496 -0
  74. data/docs/Puppeteer/TouchScreen.html +464 -0
  75. data/docs/Puppeteer/Viewport.html +757 -0
  76. data/docs/Puppeteer/WaitTask.html +211 -0
  77. data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
  78. data/docs/Puppeteer/WebSocket.html +673 -0
  79. data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
  80. data/docs/Puppeteer/WebSocketTransport.html +600 -0
  81. data/docs/Puppeteer/WebSocktTransportError.html +124 -0
  82. data/docs/_index.html +788 -0
  83. data/docs/class_list.html +51 -0
  84. data/docs/css/common.css +1 -0
  85. data/docs/css/full_list.css +58 -0
  86. data/docs/css/style.css +496 -0
  87. data/docs/file.README.html +121 -0
  88. data/docs/file_list.html +56 -0
  89. data/docs/frames.html +17 -0
  90. data/docs/index.html +121 -0
  91. data/docs/js/app.js +314 -0
  92. data/docs/js/full_list.js +216 -0
  93. data/docs/js/jquery.js +4 -0
  94. data/docs/method_list.html +3747 -0
  95. data/docs/top-level-namespace.html +126 -0
  96. data/lib/puppeteer.rb +9 -7
  97. data/lib/puppeteer/async_await_behavior.rb +6 -0
  98. data/lib/puppeteer/browser.rb +21 -1
  99. data/lib/puppeteer/connection.rb +1 -1
  100. data/lib/puppeteer/dom_world.rb +15 -2
  101. data/lib/puppeteer/element_handle.rb +3 -2
  102. data/lib/puppeteer/frame.rb +4 -0
  103. data/lib/puppeteer/frame_manager.rb +1 -1
  104. data/lib/puppeteer/js_handle.rb +3 -2
  105. data/lib/puppeteer/launcher.rb +0 -1
  106. data/lib/puppeteer/lifecycle_watcher.rb +3 -3
  107. data/lib/puppeteer/page.rb +6 -4
  108. data/lib/puppeteer/version.rb +1 -1
  109. data/puppeteer-ruby.gemspec +4 -1
  110. metadata +138 -4
@@ -0,0 +1,784 @@
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::CDPSession
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::CDPSession";
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>
41
+ &raquo;
42
+ <span class="title">CDPSession</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::CDPSession
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Puppeteer::CDPSession</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd><span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/puppeteer/cdp_session.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Defined Under Namespace</h2>
108
+ <p class="children">
109
+
110
+
111
+
112
+
113
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="CDPSession/Error.html" title="Puppeteer::CDPSession::Error (class)">Error</a></span>
114
+
115
+
116
+ </p>
117
+
118
+
119
+
120
+
121
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#connection-instance_method" title="#connection (instance method)">#<strong>connection</strong> &#x21d2; Object </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+ <span class="note title readonly">readonly</span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Returns the value of attribute connection.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ </ul>
154
+
155
+
156
+
157
+
158
+
159
+ <h2>
160
+ Instance Method Summary
161
+ <small><a href="#" class="summary_toggle">collapse</a></small>
162
+ </h2>
163
+
164
+ <ul class="summary">
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#async_send_message-instance_method" title="#async_send_message (instance method)">#<strong>async_send_message</strong>(method, params = {}) &#x21d2; Object </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'></div></span>
184
+
185
+ </li>
186
+
187
+
188
+ <li class="public ">
189
+ <span class="summary_signature">
190
+
191
+ <a href="#detach-instance_method" title="#detach (instance method)">#<strong>detach</strong> &#x21d2; Object </a>
192
+
193
+
194
+
195
+ </span>
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ <span class="summary_desc"><div class='inline'></div></span>
206
+
207
+ </li>
208
+
209
+
210
+ <li class="public ">
211
+ <span class="summary_signature">
212
+
213
+ <a href="#handle_closed-instance_method" title="#handle_closed (instance method)">#<strong>handle_closed</strong> &#x21d2; Object </a>
214
+
215
+
216
+
217
+ </span>
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'></div></span>
228
+
229
+ </li>
230
+
231
+
232
+ <li class="public ">
233
+ <span class="summary_signature">
234
+
235
+ <a href="#handle_message-instance_method" title="#handle_message (instance method)">#<strong>handle_message</strong>(message) &#x21d2; Object </a>
236
+
237
+
238
+
239
+ </span>
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ <span class="summary_desc"><div class='inline'></div></span>
250
+
251
+ </li>
252
+
253
+
254
+ <li class="public ">
255
+ <span class="summary_signature">
256
+
257
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(connection, target_type, session_id) &#x21d2; CDPSession </a>
258
+
259
+
260
+
261
+ </span>
262
+
263
+
264
+ <span class="note title constructor">constructor</span>
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'>
274
+ <p>A new instance of CDPSession.</p>
275
+ </div></span>
276
+
277
+ </li>
278
+
279
+
280
+ <li class="public ">
281
+ <span class="summary_signature">
282
+
283
+ <a href="#send_message-instance_method" title="#send_message (instance method)">#<strong>send_message</strong>(method, params = {}) &#x21d2; Object </a>
284
+
285
+
286
+
287
+ </span>
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+ <span class="summary_desc"><div class='inline'></div></span>
298
+
299
+ </li>
300
+
301
+
302
+ </ul>
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></h3>
315
+ <p class="inherited"><span class='object_link'><a href="EventCallbackable.html#add_event_listener-instance_method" title="Puppeteer::EventCallbackable#add_event_listener (method)">#add_event_listener</a></span>, <span class='object_link'><a href="EventCallbackable.html#emit_event-instance_method" title="Puppeteer::EventCallbackable#emit_event (method)">#emit_event</a></span>, <span class='object_link'><a href="EventCallbackable.html#on_event-instance_method" title="Puppeteer::EventCallbackable#on_event (method)">#on_event</a></span>, <span class='object_link'><a href="EventCallbackable.html#remove_event_listener-instance_method" title="Puppeteer::EventCallbackable#remove_event_listener (method)">#remove_event_listener</a></span></p>
316
+ <div id="constructor_details" class="method_details_list">
317
+ <h2>Constructor Details</h2>
318
+
319
+ <div class="method_details first">
320
+ <h3 class="signature first" id="initialize-instance_method">
321
+
322
+ #<strong>initialize</strong>(connection, target_type, session_id) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::CDPSession (class)">CDPSession</a></span></tt>
323
+
324
+
325
+
326
+
327
+
328
+ </h3><div class="docstring">
329
+ <div class="discussion">
330
+
331
+ <p>Returns a new instance of CDPSession.</p>
332
+
333
+
334
+ </div>
335
+ </div>
336
+ <div class="tags">
337
+ <p class="tag_title">Parameters:</p>
338
+ <ul class="param">
339
+
340
+ <li>
341
+
342
+ <span class='name'>connection</span>
343
+
344
+
345
+ <span class='type'>(<tt>!<span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></tt>)</span>
346
+
347
+
348
+
349
+ </li>
350
+
351
+ <li>
352
+
353
+ <span class='name'>targetType</span>
354
+
355
+
356
+ <span class='type'>(<tt>string</tt>)</span>
357
+
358
+
359
+
360
+ </li>
361
+
362
+ <li>
363
+
364
+ <span class='name'>sessionId</span>
365
+
366
+
367
+ <span class='type'>(<tt>string</tt>)</span>
368
+
369
+
370
+
371
+ </li>
372
+
373
+ </ul>
374
+
375
+
376
+ </div><table class="source_code">
377
+ <tr>
378
+ <td>
379
+ <pre class="lines">
380
+
381
+
382
+ 10
383
+ 11
384
+ 12
385
+ 13
386
+ 14
387
+ 15</pre>
388
+ </td>
389
+ <td>
390
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 10</span>
391
+
392
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span> <span class='id identifier rubyid_target_type'>target_type</span><span class='comma'>,</span> <span class='id identifier rubyid_session_id'>session_id</span><span class='rparen'>)</span>
393
+ <span class='ivar'>@callbacks</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
394
+ <span class='ivar'>@connection</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span>
395
+ <span class='ivar'>@target_type</span> <span class='op'>=</span> <span class='id identifier rubyid_target_type'>target_type</span>
396
+ <span class='ivar'>@session_id</span> <span class='op'>=</span> <span class='id identifier rubyid_session_id'>session_id</span>
397
+ <span class='kw'>end</span></pre>
398
+ </td>
399
+ </tr>
400
+ </table>
401
+ </div>
402
+
403
+ </div>
404
+
405
+ <div id="instance_attr_details" class="attr_details">
406
+ <h2>Instance Attribute Details</h2>
407
+
408
+
409
+ <span id=""></span>
410
+ <div class="method_details first">
411
+ <h3 class="signature first" id="connection-instance_method">
412
+
413
+ #<strong>connection</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
414
+
415
+
416
+
417
+
418
+
419
+ </h3><div class="docstring">
420
+ <div class="discussion">
421
+
422
+ <p>Returns the value of attribute connection.</p>
423
+
424
+
425
+ </div>
426
+ </div>
427
+ <div class="tags">
428
+
429
+
430
+ </div><table class="source_code">
431
+ <tr>
432
+ <td>
433
+ <pre class="lines">
434
+
435
+
436
+ 17
437
+ 18
438
+ 19</pre>
439
+ </td>
440
+ <td>
441
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 17</span>
442
+
443
+ <span class='kw'>def</span> <span class='id identifier rubyid_connection'>connection</span>
444
+ <span class='ivar'>@connection</span>
445
+ <span class='kw'>end</span></pre>
446
+ </td>
447
+ </tr>
448
+ </table>
449
+ </div>
450
+
451
+ </div>
452
+
453
+
454
+ <div id="instance_method_details" class="method_details_list">
455
+ <h2>Instance Method Details</h2>
456
+
457
+
458
+ <div class="method_details first">
459
+ <h3 class="signature first" id="async_send_message-instance_method">
460
+
461
+ #<strong>async_send_message</strong>(method, params = {}) &#x21d2; <tt>Object</tt>
462
+
463
+
464
+
465
+
466
+
467
+ </h3><div class="docstring">
468
+ <div class="discussion">
469
+
470
+
471
+ </div>
472
+ </div>
473
+ <div class="tags">
474
+ <p class="tag_title">Parameters:</p>
475
+ <ul class="param">
476
+
477
+ <li>
478
+
479
+ <span class='name'>method</span>
480
+
481
+
482
+ <span class='type'>(<tt>String</tt>)</span>
483
+
484
+
485
+
486
+ </li>
487
+
488
+ <li>
489
+
490
+ <span class='name'>params</span>
491
+
492
+
493
+ <span class='type'>(<tt>Hash</tt>)</span>
494
+
495
+
496
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
497
+
498
+
499
+ </li>
500
+
501
+ </ul>
502
+
503
+
504
+ </div><table class="source_code">
505
+ <tr>
506
+ <td>
507
+ <pre class="lines">
508
+
509
+
510
+ 29
511
+ 30
512
+ 31
513
+ 32
514
+ 33
515
+ 34
516
+ 35
517
+ 36
518
+ 37</pre>
519
+ </td>
520
+ <td>
521
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 29</span>
522
+
523
+ <span class='kw'>def</span> <span class='id identifier rubyid_async_send_message'>async_send_message</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
524
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@connection</span>
525
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="CDPSession/Error.html" title="Puppeteer::CDPSession::Error (class)">Error</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::CDPSession#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Protocol error (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_method'>method</span><span class='embexpr_end'>}</span><span class='tstring_content'>): Session closed. Most likely the </span><span class='embexpr_beg'>#{</span><span class='ivar'>@target_type</span><span class='embexpr_end'>}</span><span class='tstring_content'> has been closed.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
526
+ <span class='kw'>end</span>
527
+ <span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_raw_send'>raw_send</span><span class='lparen'>(</span><span class='label'>message:</span> <span class='lbrace'>{</span> <span class='label'>sessionId:</span> <span class='ivar'>@session_id</span><span class='comma'>,</span> <span class='label'>method:</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>params:</span> <span class='id identifier rubyid_params'>params</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
528
+ <span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_resolvable_future'><span class='object_link'><a href="ConcurrentRubyUtils.html#resolvable_future-instance_method" title="Puppeteer::ConcurrentRubyUtils#resolvable_future (method)">resolvable_future</a></span></span>
529
+ <span class='ivar'>@callbacks</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</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="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Connection/MessageCallback.html" title="Puppeteer::Connection::MessageCallback (class)">MessageCallback</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Connection/MessageCallback.html#initialize-instance_method" title="Puppeteer::Connection::MessageCallback#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>method:</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>promise:</span> <span class='id identifier rubyid_promise'>promise</span><span class='rparen'>)</span>
530
+ <span class='id identifier rubyid_promise'>promise</span>
531
+ <span class='kw'>end</span></pre>
532
+ </td>
533
+ </tr>
534
+ </table>
535
+ </div>
536
+
537
+ <div class="method_details ">
538
+ <h3 class="signature " id="detach-instance_method">
539
+
540
+ #<strong>detach</strong> &#x21d2; <tt>Object</tt>
541
+
542
+
543
+
544
+
545
+
546
+ </h3><table class="source_code">
547
+ <tr>
548
+ <td>
549
+ <pre class="lines">
550
+
551
+
552
+ 60
553
+ 61
554
+ 62
555
+ 63
556
+ 64
557
+ 65</pre>
558
+ </td>
559
+ <td>
560
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 60</span>
561
+
562
+ <span class='kw'>def</span> <span class='id identifier rubyid_detach'>detach</span>
563
+ <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@connection</span>
564
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="CDPSession/Error.html" title="Puppeteer::CDPSession::Error (class)">Error</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::CDPSession#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Session already detarched. Most likely the </span><span class='embexpr_beg'>#{</span><span class='ivar'>@target_type</span><span class='embexpr_end'>}</span><span class='tstring_content'> has been closed.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
565
+ <span class='kw'>end</span>
566
+ <span class='ivar'>@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.detachFromTarget</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>sessionId:</span> <span class='ivar'>@session_id</span><span class='rparen'>)</span>
567
+ <span class='kw'>end</span></pre>
568
+ </td>
569
+ </tr>
570
+ </table>
571
+ </div>
572
+
573
+ <div class="method_details ">
574
+ <h3 class="signature " id="handle_closed-instance_method">
575
+
576
+ #<strong>handle_closed</strong> &#x21d2; <tt>Object</tt>
577
+
578
+
579
+
580
+
581
+
582
+ </h3><table class="source_code">
583
+ <tr>
584
+ <td>
585
+ <pre class="lines">
586
+
587
+
588
+ 67
589
+ 68
590
+ 69
591
+ 70
592
+ 71
593
+ 72
594
+ 73
595
+ 74
596
+ 75
597
+ 76
598
+ 77</pre>
599
+ </td>
600
+ <td>
601
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 67</span>
602
+
603
+ <span class='kw'>def</span> <span class='id identifier rubyid_handle_closed'>handle_closed</span>
604
+ <span class='ivar'>@callbacks</span><span class='period'>.</span><span class='id identifier rubyid_each_value'>each_value</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_callback'>callback</span><span class='op'>|</span>
605
+ <span class='id identifier rubyid_callback'>callback</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span>
606
+ <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="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Connection/ProtocolError.html" title="Puppeteer::Connection::ProtocolError (class)">ProtocolError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Connection/ProtocolError.html#initialize-instance_method" title="Puppeteer::Connection::ProtocolError#initialize (method)">new</a></span></span><span class='lparen'>(</span>
607
+ <span class='label'>method:</span> <span class='id identifier rubyid_callback'>callback</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span>
608
+ <span class='label'>error_message:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Target Closed.</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
609
+ <span class='kw'>end</span>
610
+ <span class='ivar'>@callbacks</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
611
+ <span class='ivar'>@connection</span> <span class='op'>=</span> <span class='kw'>nil</span>
612
+ <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.CDPSession.Disconnected</span><span class='tstring_end'>&#39;</span></span>
613
+ <span class='kw'>end</span></pre>
614
+ </td>
615
+ </tr>
616
+ </table>
617
+ </div>
618
+
619
+ <div class="method_details ">
620
+ <h3 class="signature " id="handle_message-instance_method">
621
+
622
+ #<strong>handle_message</strong>(message) &#x21d2; <tt>Object</tt>
623
+
624
+
625
+
626
+
627
+
628
+ </h3><div class="docstring">
629
+ <div class="discussion">
630
+
631
+
632
+ </div>
633
+ </div>
634
+ <div class="tags">
635
+ <p class="tag_title">Parameters:</p>
636
+ <ul class="param">
637
+
638
+ <li>
639
+
640
+ <span class='name'>object</span>
641
+
642
+
643
+ <span class='type'>(<tt>{id?: number, method: string, params: Object, error: {message: string, data: any}, result?: *}</tt>)</span>
644
+
645
+
646
+
647
+ </li>
648
+
649
+ </ul>
650
+
651
+
652
+ </div><table class="source_code">
653
+ <tr>
654
+ <td>
655
+ <pre class="lines">
656
+
657
+
658
+ 40
659
+ 41
660
+ 42
661
+ 43
662
+ 44
663
+ 45
664
+ 46
665
+ 47
666
+ 48
667
+ 49
668
+ 50
669
+ 51
670
+ 52
671
+ 53
672
+ 54
673
+ 55
674
+ 56
675
+ 57
676
+ 58</pre>
677
+ </td>
678
+ <td>
679
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 40</span>
680
+
681
+ <span class='kw'>def</span> <span class='id identifier rubyid_handle_message'>handle_message</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
682
+ <span class='kw'>if</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
683
+ <span class='kw'>if</span> <span class='id identifier rubyid_callback'>callback</span> <span class='op'>=</span> <span class='ivar'>@callbacks</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
684
+ <span class='kw'>if</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>error</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
685
+ <span class='id identifier rubyid_callback'>callback</span><span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span><span class='lparen'>(</span>
686
+ <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="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Connection/ProtocolError.html" title="Puppeteer::Connection::ProtocolError (class)">ProtocolError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Connection/ProtocolError.html#initialize-instance_method" title="Puppeteer::Connection::ProtocolError#initialize (method)">new</a></span></span><span class='lparen'>(</span>
687
+ <span class='label'>method:</span> <span class='id identifier rubyid_callback'>callback</span><span class='period'>.</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span>
688
+ <span class='label'>error_message:</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>error</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>message</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
689
+ <span class='label'>error_data:</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>error</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>data</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
690
+ <span class='kw'>else</span>
691
+ <span class='id identifier rubyid_callback'>callback</span><span class='period'>.</span><span class='id identifier rubyid_resolve'>resolve</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>result</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
692
+ <span class='kw'>end</span>
693
+ <span class='kw'>else</span>
694
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="CDPSession/Error.html" title="Puppeteer::CDPSession::Error (class)">Error</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::CDPSession#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>unknown id: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
695
+ <span class='kw'>end</span>
696
+ <span class='kw'>else</span>
697
+ <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>method</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>params</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
698
+ <span class='kw'>end</span>
699
+ <span class='kw'>end</span></pre>
700
+ </td>
701
+ </tr>
702
+ </table>
703
+ </div>
704
+
705
+ <div class="method_details ">
706
+ <h3 class="signature " id="send_message-instance_method">
707
+
708
+ #<strong>send_message</strong>(method, params = {}) &#x21d2; <tt>Object</tt>
709
+
710
+
711
+
712
+
713
+
714
+ </h3><div class="docstring">
715
+ <div class="discussion">
716
+
717
+
718
+ </div>
719
+ </div>
720
+ <div class="tags">
721
+ <p class="tag_title">Parameters:</p>
722
+ <ul class="param">
723
+
724
+ <li>
725
+
726
+ <span class='name'>method</span>
727
+
728
+
729
+ <span class='type'>(<tt>String</tt>)</span>
730
+
731
+
732
+
733
+ </li>
734
+
735
+ <li>
736
+
737
+ <span class='name'>params</span>
738
+
739
+
740
+ <span class='type'>(<tt>Hash</tt>)</span>
741
+
742
+
743
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
744
+
745
+
746
+ </li>
747
+
748
+ </ul>
749
+
750
+
751
+ </div><table class="source_code">
752
+ <tr>
753
+ <td>
754
+ <pre class="lines">
755
+
756
+
757
+ 22
758
+ 23
759
+ 24</pre>
760
+ </td>
761
+ <td>
762
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/cdp_session.rb', line 22</span>
763
+
764
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
765
+ <span class='id identifier rubyid_await'><span class='object_link'><a href="ConcurrentRubyUtils.html#await-instance_method" title="Puppeteer::ConcurrentRubyUtils#await (method)">await</a></span></span> <span class='id identifier rubyid_async_send_message'>async_send_message</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
766
+ <span class='kw'>end</span></pre>
767
+ </td>
768
+ </tr>
769
+ </table>
770
+ </div>
771
+
772
+ </div>
773
+
774
+ </div>
775
+
776
+ <div id="footer">
777
+ Generated on Sun Apr 26 15:52:57 2020 by
778
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
779
+ 0.9.24 (ruby-2.6.3).
780
+ </div>
781
+
782
+ </div>
783
+ </body>
784
+ </html>