puppeteer-ruby 0.0.12 → 0.0.17

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/README.md +52 -1
  6. data/lib/puppeteer.rb +10 -2
  7. data/lib/puppeteer/browser.rb +53 -34
  8. data/lib/puppeteer/browser_context.rb +35 -5
  9. data/lib/puppeteer/cdp_session.rb +3 -19
  10. data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
  11. data/lib/puppeteer/connection.rb +9 -16
  12. data/lib/puppeteer/debug_print.rb +1 -1
  13. data/lib/puppeteer/define_async_method.rb +23 -0
  14. data/lib/puppeteer/dom_world.rb +67 -78
  15. data/lib/puppeteer/element_handle.rb +19 -47
  16. data/lib/puppeteer/emulation_manager.rb +2 -6
  17. data/lib/puppeteer/env.rb +18 -0
  18. data/lib/puppeteer/execution_context.rb +1 -6
  19. data/lib/puppeteer/frame.rb +34 -39
  20. data/lib/puppeteer/frame_manager.rb +7 -25
  21. data/lib/puppeteer/js_handle.rb +3 -12
  22. data/lib/puppeteer/keyboard.rb +9 -29
  23. data/lib/puppeteer/launcher/chrome.rb +9 -7
  24. data/lib/puppeteer/mouse.rb +20 -24
  25. data/lib/puppeteer/network_manager.rb +163 -5
  26. data/lib/puppeteer/page.rb +213 -179
  27. data/lib/puppeteer/page/pdf_options.rb +166 -0
  28. data/lib/puppeteer/remote_object.rb +2 -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 +2 -4
  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 -2219
  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 -3813
  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 -669
  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 -4115
  134. data/docs/top-level-namespace.html +0 -126
  135. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,1087 +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::RemoteObject
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::RemoteObject";
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 (R)</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">RemoteObject</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::RemoteObject
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::RemoteObject</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="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span></dd>
93
- </dl>
94
-
95
-
96
-
97
-
98
-
99
-
100
- <dl>
101
- <dt>Defined in:</dt>
102
- <dd>lib/puppeteer/remote_object.rb</dd>
103
- </dl>
104
-
105
- </div>
106
-
107
- <h2>Overview</h2><div class="docstring">
108
- <div class="discussion">
109
-
110
- <p>providing #valueFromRemoteObject, #releaseObject</p>
111
-
112
-
113
- </div>
114
- </div>
115
- <div class="tags">
116
-
117
-
118
- </div>
119
-
120
-
121
-
122
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
123
- <ul class="summary">
124
-
125
- <li class="public ">
126
- <span class="summary_signature">
127
-
128
- <a href="#sub_type-instance_method" title="#sub_type (instance method)">#<strong>sub_type</strong> &#x21d2; Object </a>
129
-
130
-
131
-
132
- </span>
133
-
134
-
135
-
136
-
137
- <span class="note title readonly">readonly</span>
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
- <span class="summary_desc"><div class='inline'>
148
- <p>Returns the value of attribute sub_type.</p>
149
- </div></span>
150
-
151
- </li>
152
-
153
-
154
- </ul>
155
-
156
-
157
-
158
-
159
-
160
- <h2>
161
- Instance Method Summary
162
- <small><a href="#" class="summary_toggle">collapse</a></small>
163
- </h2>
164
-
165
- <ul class="summary">
166
-
167
- <li class="public ">
168
- <span class="summary_signature">
169
-
170
- <a href="#box_model-instance_method" title="#box_model (instance method)">#<strong>box_model</strong>(client) &#x21d2; Object </a>
171
-
172
-
173
-
174
- </span>
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
- <span class="summary_desc"><div class='inline'>
185
- <p>used in ElementHandle#_box_model.</p>
186
- </div></span>
187
-
188
- </li>
189
-
190
-
191
- <li class="public ">
192
- <span class="summary_signature">
193
-
194
- <a href="#content_quads-instance_method" title="#content_quads (instance method)">#<strong>content_quads</strong>(client) &#x21d2; Object </a>
195
-
196
-
197
-
198
- </span>
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
- <span class="summary_desc"><div class='inline'>
209
- <p>used in ElementHandle#clickable_point.</p>
210
- </div></span>
211
-
212
- </li>
213
-
214
-
215
- <li class="public ">
216
- <span class="summary_signature">
217
-
218
- <a href="#converted_arg-instance_method" title="#converted_arg (instance method)">#<strong>converted_arg</strong> &#x21d2; Object </a>
219
-
220
-
221
-
222
- </span>
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
- <span class="summary_desc"><div class='inline'></div></span>
233
-
234
- </li>
235
-
236
-
237
- <li class="public ">
238
- <span class="summary_signature">
239
-
240
- <a href="#evaluate_self-instance_method" title="#evaluate_self (instance method)">#<strong>evaluate_self</strong>(client) &#x21d2; Future&lt;Puppeteer::RemoteObject|nil&gt; </a>
241
-
242
-
243
-
244
- </span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- <span class="summary_desc"><div class='inline'></div></span>
255
-
256
- </li>
257
-
258
-
259
- <li class="public ">
260
- <span class="summary_signature">
261
-
262
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(payload) &#x21d2; RemoteObject </a>
263
-
264
-
265
-
266
- </span>
267
-
268
-
269
- <span class="note title constructor">constructor</span>
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
- <span class="summary_desc"><div class='inline'>
279
- <p>A new instance of RemoteObject.</p>
280
- </div></span>
281
-
282
- </li>
283
-
284
-
285
- <li class="public ">
286
- <span class="summary_signature">
287
-
288
- <a href="#node_info-instance_method" title="#node_info (instance method)">#<strong>node_info</strong>(client) &#x21d2; Object </a>
289
-
290
-
291
-
292
- </span>
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
- <span class="summary_desc"><div class='inline'>
303
- <p>used in ElementHandle#content_frame, ElementHandle#upload_file.</p>
304
- </div></span>
305
-
306
- </li>
307
-
308
-
309
- <li class="public ">
310
- <span class="summary_signature">
311
-
312
- <a href="#properties-instance_method" title="#properties (instance method)">#<strong>properties</strong>(client) &#x21d2; Object </a>
313
-
314
-
315
-
316
- </span>
317
-
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
- <span class="summary_desc"><div class='inline'>
327
- <p>used in JSHandle#properties.</p>
328
- </div></span>
329
-
330
- </li>
331
-
332
-
333
- <li class="public ">
334
- <span class="summary_signature">
335
-
336
- <a href="#release-instance_method" title="#release (instance method)">#<strong>release</strong>(client) &#x21d2; Object </a>
337
-
338
-
339
-
340
- </span>
341
-
342
-
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
- <span class="summary_desc"><div class='inline'></div></span>
351
-
352
- </li>
353
-
354
-
355
- <li class="public ">
356
- <span class="summary_signature">
357
-
358
- <a href="#set_file_input_files-instance_method" title="#set_file_input_files (instance method)">#<strong>set_file_input_files</strong>(client, files, backend_node_id) &#x21d2; Object </a>
359
-
360
-
361
-
362
- </span>
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
-
371
-
372
- <span class="summary_desc"><div class='inline'>
373
- <p>used in ElementHandle#upload_file.</p>
374
- </div></span>
375
-
376
- </li>
377
-
378
-
379
- <li class="public ">
380
- <span class="summary_signature">
381
-
382
- <a href="#value-instance_method" title="#value (instance method)">#<strong>value</strong> &#x21d2; Object </a>
383
-
384
-
385
-
386
- </span>
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
- <span class="summary_desc"><div class='inline'>
397
- <p>helper#valueFromRemoteObject.</p>
398
- </div></span>
399
-
400
- </li>
401
-
402
-
403
- </ul>
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
- <h3 class="inherited">Methods included from <span class='object_link'><a href="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span></h3>
416
- <p class="inherited"><span class='object_link'><a href="DebugPrint.html#debug_print-instance_method" title="Puppeteer::DebugPrint#debug_print (method)">#debug_print</a></span>, <span class='object_link'><a href="DebugPrint.html#debug_puts-instance_method" title="Puppeteer::DebugPrint#debug_puts (method)">#debug_puts</a></span></p>
417
- <div id="constructor_details" class="method_details_list">
418
- <h2>Constructor Details</h2>
419
-
420
- <div class="method_details first">
421
- <h3 class="signature first" id="initialize-instance_method">
422
-
423
- #<strong>initialize</strong>(payload) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::RemoteObject (class)">RemoteObject</a></span></tt>
424
-
425
-
426
-
427
-
428
-
429
- </h3><div class="docstring">
430
- <div class="discussion">
431
-
432
- <p>Returns a new instance of RemoteObject.</p>
433
-
434
-
435
- </div>
436
- </div>
437
- <div class="tags">
438
- <p class="tag_title">Parameters:</p>
439
- <ul class="param">
440
-
441
- <li>
442
-
443
- <span class='name'>payload</span>
444
-
445
-
446
- <span class='type'>(<tt>Hash</tt>)</span>
447
-
448
-
449
-
450
- </li>
451
-
452
- </ul>
453
-
454
-
455
- </div><table class="source_code">
456
- <tr>
457
- <td>
458
- <pre class="lines">
459
-
460
-
461
- 7
462
- 8
463
- 9
464
- 10
465
- 11
466
- 12</pre>
467
- </td>
468
- <td>
469
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 7</span>
470
-
471
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
472
- <span class='ivar'>@object_id</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>objectId</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
473
- <span class='ivar'>@sub_type</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>subtype</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
474
- <span class='ivar'>@unserializable_value</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>unserializableValue</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
475
- <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>value</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
476
- <span class='kw'>end</span></pre>
477
- </td>
478
- </tr>
479
- </table>
480
- </div>
481
-
482
- </div>
483
-
484
- <div id="instance_attr_details" class="attr_details">
485
- <h2>Instance Attribute Details</h2>
486
-
487
-
488
- <span id=""></span>
489
- <div class="method_details first">
490
- <h3 class="signature first" id="sub_type-instance_method">
491
-
492
- #<strong>sub_type</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
493
-
494
-
495
-
496
-
497
-
498
- </h3><div class="docstring">
499
- <div class="discussion">
500
-
501
- <p>Returns the value of attribute sub_type.</p>
502
-
503
-
504
- </div>
505
- </div>
506
- <div class="tags">
507
-
508
-
509
- </div><table class="source_code">
510
- <tr>
511
- <td>
512
- <pre class="lines">
513
-
514
-
515
- 14
516
- 15
517
- 16</pre>
518
- </td>
519
- <td>
520
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 14</span>
521
-
522
- <span class='kw'>def</span> <span class='id identifier rubyid_sub_type'>sub_type</span>
523
- <span class='ivar'>@sub_type</span>
524
- <span class='kw'>end</span></pre>
525
- </td>
526
- </tr>
527
- </table>
528
- </div>
529
-
530
- </div>
531
-
532
-
533
- <div id="instance_method_details" class="method_details_list">
534
- <h2>Instance Method Details</h2>
535
-
536
-
537
- <div class="method_details first">
538
- <h3 class="signature first" id="box_model-instance_method">
539
-
540
- #<strong>box_model</strong>(client) &#x21d2; <tt>Object</tt>
541
-
542
-
543
-
544
-
545
-
546
- </h3><div class="docstring">
547
- <div class="discussion">
548
-
549
- <p>used in ElementHandle#_box_model</p>
550
-
551
-
552
- </div>
553
- </div>
554
- <div class="tags">
555
-
556
-
557
- </div><table class="source_code">
558
- <tr>
559
- <td>
560
- <pre class="lines">
561
-
562
-
563
- 66
564
- 67
565
- 68
566
- 69
567
- 70
568
- 71</pre>
569
- </td>
570
- <td>
571
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 66</span>
572
-
573
- <span class='kw'>def</span> <span class='id identifier rubyid_box_model'>box_model</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
574
- <span class='id identifier rubyid_client'>client</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'>DOM.getBoxModel</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='rparen'>)</span>
575
- <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_err'>err</span>
576
- <span class='id identifier rubyid_debug_puts'>debug_puts</span><span class='lparen'>(</span><span class='id identifier rubyid_err'>err</span><span class='rparen'>)</span>
577
- <span class='kw'>nil</span>
578
- <span class='kw'>end</span></pre>
579
- </td>
580
- </tr>
581
- </table>
582
- </div>
583
-
584
- <div class="method_details ">
585
- <h3 class="signature " id="content_quads-instance_method">
586
-
587
- #<strong>content_quads</strong>(client) &#x21d2; <tt>Object</tt>
588
-
589
-
590
-
591
-
592
-
593
- </h3><div class="docstring">
594
- <div class="discussion">
595
-
596
- <p>used in ElementHandle#clickable_point</p>
597
-
598
-
599
- </div>
600
- </div>
601
- <div class="tags">
602
-
603
-
604
- </div><table class="source_code">
605
- <tr>
606
- <td>
607
- <pre class="lines">
608
-
609
-
610
- 61
611
- 62
612
- 63</pre>
613
- </td>
614
- <td>
615
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 61</span>
616
-
617
- <span class='kw'>def</span> <span class='id identifier rubyid_content_quads'>content_quads</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
618
- <span class='id identifier rubyid_client'>client</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'>DOM.getContentQuads</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='rparen'>)</span>
619
- <span class='kw'>end</span></pre>
620
- </td>
621
- </tr>
622
- </table>
623
- </div>
624
-
625
- <div class="method_details ">
626
- <h3 class="signature " id="converted_arg-instance_method">
627
-
628
- #<strong>converted_arg</strong> &#x21d2; <tt>Object</tt>
629
-
630
-
631
-
632
-
633
-
634
- </h3><table class="source_code">
635
- <tr>
636
- <td>
637
- <pre class="lines">
638
-
639
-
640
- 119
641
- 120
642
- 121
643
- 122
644
- 123
645
- 124
646
- 125
647
- 126
648
- 127
649
- 128
650
- 129
651
- 130
652
- 131
653
- 132
654
- 133
655
- 134
656
- 135
657
- 136
658
- 137</pre>
659
- </td>
660
- <td>
661
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 119</span>
662
-
663
- <span class='kw'>def</span> <span class='id identifier rubyid_converted_arg'>converted_arg</span>
664
- <span class='comment'># ported logic from ExecutionContext#convertArgument
665
- </span> <span class='comment'># https://github.com/puppeteer/puppeteer/blob/master/lib/ExecutionContext.js
666
- </span> <span class='comment'>#
667
- </span> <span class='comment'># Original logic:
668
- </span> <span class='comment'># if (objectHandle._remoteObject.unserializableValue)
669
- </span> <span class='comment'># return { unserializableValue: objectHandle._remoteObject.unserializableValue };
670
- </span> <span class='comment'># if (!objectHandle._remoteObject.objectId)
671
- </span> <span class='comment'># return { value: objectHandle._remoteObject.value };
672
- </span> <span class='comment'># return { objectId: objectHandle._remoteObject.objectId };
673
- </span>
674
- <span class='kw'>if</span> <span class='ivar'>@unserializable_value</span>
675
- <span class='lbrace'>{</span> <span class='label'>unserializableValue:</span> <span class='ivar'>@unserializable_value</span> <span class='rbrace'>}</span>
676
- <span class='kw'>elsif</span> <span class='ivar'>@object_id</span>
677
- <span class='lbrace'>{</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span> <span class='rbrace'>}</span>
678
- <span class='kw'>else</span>
679
- <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span>
680
- <span class='kw'>end</span>
681
- <span class='kw'>end</span></pre>
682
- </td>
683
- </tr>
684
- </table>
685
- </div>
686
-
687
- <div class="method_details ">
688
- <h3 class="signature " id="evaluate_self-instance_method">
689
-
690
- #<strong>evaluate_self</strong>(client) &#x21d2; <tt>Future&lt;<span class='object_link'><a href="" title="Puppeteer::RemoteObject (class)">Puppeteer::RemoteObject</a></span>|nil&gt;</tt>
691
-
692
-
693
-
694
-
695
-
696
- </h3><div class="docstring">
697
- <div class="discussion">
698
-
699
-
700
- </div>
701
- </div>
702
- <div class="tags">
703
-
704
- <p class="tag_title">Returns:</p>
705
- <ul class="return">
706
-
707
- <li>
708
-
709
-
710
- <span class='type'>(<tt>Future&lt;<span class='object_link'><a href="" title="Puppeteer::RemoteObject (class)">Puppeteer::RemoteObject</a></span>|nil&gt;</tt>)</span>
711
-
712
-
713
-
714
- </li>
715
-
716
- </ul>
717
-
718
- </div><table class="source_code">
719
- <tr>
720
- <td>
721
- <pre class="lines">
722
-
723
-
724
- 17
725
- 18
726
- 19
727
- 20
728
- 21
729
- 22
730
- 23
731
- 24
732
- 25
733
- 26
734
- 27
735
- 28
736
- 29
737
- 30
738
- 31
739
- 32
740
- 33
741
- 34
742
- 35
743
- 36
744
- 37
745
- 38
746
- 39
747
- 40
748
- 41
749
- 42
750
- 43</pre>
751
- </td>
752
- <td>
753
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 17</span>
754
-
755
- <span class='kw'>def</span> <span class='id identifier rubyid_evaluate_self'>evaluate_self</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
756
- <span class='comment'># ported logic from JSHandle#json_value.
757
- </span>
758
- <span class='comment'># original logic:
759
- </span> <span class='comment'># if (this._remoteObject.objectId) {
760
- </span> <span class='comment'># const response = await this._client.send(&#39;Runtime.callFunctionOn&#39;, {
761
- </span> <span class='comment'># functionDeclaration: &#39;function() { return this; }&#39;,
762
- </span> <span class='comment'># objectId: this._remoteObject.objectId,
763
- </span> <span class='comment'># returnByValue: true,
764
- </span> <span class='comment'># awaitPromise: true,
765
- </span> <span class='comment'># });
766
- </span> <span class='comment'># return helper.valueFromRemoteObject(response.result);
767
- </span> <span class='comment'># }
768
- </span>
769
- <span class='kw'>if</span> <span class='ivar'>@object_id</span>
770
- <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span>
771
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>functionDeclaration</span><span class='label_end'>&#39;:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>function() { return this; }</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
772
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>objectId</span><span class='label_end'>&#39;:</span> <span class='ivar'>@object_id</span><span class='comma'>,</span>
773
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>returnByValue</span><span class='label_end'>&#39;:</span> <span class='kw'>true</span><span class='comma'>,</span>
774
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>awaitPromise</span><span class='label_end'>&#39;:</span> <span class='kw'>true</span><span class='comma'>,</span>
775
- <span class='rbrace'>}</span>
776
- <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</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'>Runtime.callFunctionOn</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
777
- <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="" title="Puppeteer::RemoteObject (class)">RemoteObject</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::RemoteObject#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</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>
778
- <span class='kw'>else</span>
779
- <span class='kw'>nil</span>
780
- <span class='kw'>end</span>
781
- <span class='kw'>end</span></pre>
782
- </td>
783
- </tr>
784
- </table>
785
- </div>
786
-
787
- <div class="method_details ">
788
- <h3 class="signature " id="node_info-instance_method">
789
-
790
- #<strong>node_info</strong>(client) &#x21d2; <tt>Object</tt>
791
-
792
-
793
-
794
-
795
-
796
- </h3><div class="docstring">
797
- <div class="discussion">
798
-
799
- <p>used in ElementHandle#content_frame, ElementHandle#upload_file</p>
800
-
801
-
802
- </div>
803
- </div>
804
- <div class="tags">
805
-
806
-
807
- </div><table class="source_code">
808
- <tr>
809
- <td>
810
- <pre class="lines">
811
-
812
-
813
- 56
814
- 57
815
- 58</pre>
816
- </td>
817
- <td>
818
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 56</span>
819
-
820
- <span class='kw'>def</span> <span class='id identifier rubyid_node_info'>node_info</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
821
- <span class='id identifier rubyid_client'>client</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'>DOM.describeNode</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='rparen'>)</span>
822
- <span class='kw'>end</span></pre>
823
- </td>
824
- </tr>
825
- </table>
826
- </div>
827
-
828
- <div class="method_details ">
829
- <h3 class="signature " id="properties-instance_method">
830
-
831
- #<strong>properties</strong>(client) &#x21d2; <tt>Object</tt>
832
-
833
-
834
-
835
-
836
-
837
- </h3><div class="docstring">
838
- <div class="discussion">
839
-
840
- <p>used in JSHandle#properties</p>
841
-
842
-
843
- </div>
844
- </div>
845
- <div class="tags">
846
-
847
-
848
- </div><table class="source_code">
849
- <tr>
850
- <td>
851
- <pre class="lines">
852
-
853
-
854
- 46
855
- 47
856
- 48
857
- 49
858
- 50
859
- 51
860
- 52
861
- 53</pre>
862
- </td>
863
- <td>
864
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 46</span>
865
-
866
- <span class='kw'>def</span> <span class='id identifier rubyid_properties'>properties</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
867
- <span class='comment'># original logic:
868
- </span> <span class='comment'># const response = await this._client.send(&#39;Runtime.getProperties&#39;, {
869
- </span> <span class='comment'># objectId: this._remoteObject.objectId,
870
- </span> <span class='comment'># ownProperties: true
871
- </span> <span class='comment'># });
872
- </span> <span class='id identifier rubyid_client'>client</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'>Runtime.getProperties</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='comma'>,</span> <span class='label'>ownProperties:</span> <span class='kw'>true</span><span class='rparen'>)</span>
873
- <span class='kw'>end</span></pre>
874
- </td>
875
- </tr>
876
- </table>
877
- </div>
878
-
879
- <div class="method_details ">
880
- <h3 class="signature " id="release-instance_method">
881
-
882
- #<strong>release</strong>(client) &#x21d2; <tt>Object</tt>
883
-
884
-
885
-
886
-
887
-
888
- </h3><div class="docstring">
889
- <div class="discussion">
890
-
891
-
892
- </div>
893
- </div>
894
- <div class="tags">
895
- <p class="tag_title">Parameters:</p>
896
- <ul class="param">
897
-
898
- <li>
899
-
900
- <span class='name'>client</span>
901
-
902
-
903
- <span class='type'>(<tt><span class='object_link'><a href="CDPSession.html" title="Puppeteer::CDPSession (class)">Puppeteer::CDPSession</a></span></tt>)</span>
904
-
905
-
906
-
907
- </li>
908
-
909
- </ul>
910
-
911
-
912
- </div><table class="source_code">
913
- <tr>
914
- <td>
915
- <pre class="lines">
916
-
917
-
918
- 98
919
- 99
920
- 100
921
- 101
922
- 102
923
- 103
924
- 104
925
- 105
926
- 106
927
- 107
928
- 108
929
- 109
930
- 110
931
- 111
932
- 112</pre>
933
- </td>
934
- <td>
935
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 98</span>
936
-
937
- <span class='kw'>def</span> <span class='id identifier rubyid_release'>release</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
938
- <span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@object_id</span>
939
-
940
- <span class='kw'>begin</span>
941
- <span class='id identifier rubyid_client'>client</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'>Runtime.releaseObject</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
942
- <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='comma'>,</span>
943
- <span class='rparen'>)</span>
944
- <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_err'>err</span>
945
- <span class='comment'># Exceptions might happen in case of a page been navigated or closed.
946
- </span> <span class='comment'># Swallow these since they are harmless and we don&#39;t leak anything in this case.
947
- </span> <span class='id identifier rubyid_debug_puts'>debug_puts</span><span class='lparen'>(</span><span class='id identifier rubyid_err'>err</span><span class='rparen'>)</span>
948
- <span class='kw'>end</span>
949
-
950
- <span class='kw'>nil</span>
951
- <span class='kw'>end</span></pre>
952
- </td>
953
- </tr>
954
- </table>
955
- </div>
956
-
957
- <div class="method_details ">
958
- <h3 class="signature " id="set_file_input_files-instance_method">
959
-
960
- #<strong>set_file_input_files</strong>(client, files, backend_node_id) &#x21d2; <tt>Object</tt>
961
-
962
-
963
-
964
-
965
-
966
- </h3><div class="docstring">
967
- <div class="discussion">
968
-
969
- <p>used in ElementHandle#upload_file</p>
970
-
971
-
972
- </div>
973
- </div>
974
- <div class="tags">
975
-
976
-
977
- </div><table class="source_code">
978
- <tr>
979
- <td>
980
- <pre class="lines">
981
-
982
-
983
- 140
984
- 141
985
- 142</pre>
986
- </td>
987
- <td>
988
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 140</span>
989
-
990
- <span class='kw'>def</span> <span class='id identifier rubyid_set_file_input_files'>set_file_input_files</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='id identifier rubyid_files'>files</span><span class='comma'>,</span> <span class='id identifier rubyid_backend_node_id'>backend_node_id</span><span class='rparen'>)</span>
991
- <span class='id identifier rubyid_client'>client</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'>DOM.setFileInputFiles</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>objectId:</span> <span class='ivar'>@object_id</span><span class='comma'>,</span> <span class='label'>files:</span> <span class='id identifier rubyid_files'>files</span><span class='comma'>,</span> <span class='label'>backendNodeId:</span> <span class='id identifier rubyid_backend_node_id'>backend_node_id</span><span class='rparen'>)</span>
992
- <span class='kw'>end</span></pre>
993
- </td>
994
- </tr>
995
- </table>
996
- </div>
997
-
998
- <div class="method_details ">
999
- <h3 class="signature " id="value-instance_method">
1000
-
1001
- #<strong>value</strong> &#x21d2; <tt>Object</tt>
1002
-
1003
-
1004
-
1005
-
1006
-
1007
- </h3><div class="docstring">
1008
- <div class="discussion">
1009
-
1010
- <p>helper#valueFromRemoteObject</p>
1011
-
1012
-
1013
- </div>
1014
- </div>
1015
- <div class="tags">
1016
-
1017
-
1018
- </div><table class="source_code">
1019
- <tr>
1020
- <td>
1021
- <pre class="lines">
1022
-
1023
-
1024
- 75
1025
- 76
1026
- 77
1027
- 78
1028
- 79
1029
- 80
1030
- 81
1031
- 82
1032
- 83
1033
- 84
1034
- 85
1035
- 86
1036
- 87
1037
- 88
1038
- 89
1039
- 90
1040
- 91
1041
- 92
1042
- 93
1043
- 94
1044
- 95</pre>
1045
- </td>
1046
- <td>
1047
- <pre class="code"><span class="info file"># File 'lib/puppeteer/remote_object.rb', line 75</span>
1048
-
1049
- <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
1050
- <span class='kw'>if</span> <span class='ivar'>@unserializable_value</span>
1051
- <span class='comment'># if (remoteObject.type === &#39;bigint&#39; &amp;&amp; typeof BigInt !== &#39;undefined&#39;)
1052
- </span> <span class='comment'># return BigInt(remoteObject.unserializableValue.replace(&#39;n&#39;, &#39;&#39;));
1053
- </span> <span class='comment'># switch (remoteObject.unserializableValue) {
1054
- </span> <span class='comment'># case &#39;-0&#39;:
1055
- </span> <span class='comment'># return -0;
1056
- </span> <span class='comment'># case &#39;NaN&#39;:
1057
- </span> <span class='comment'># return NaN;
1058
- </span> <span class='comment'># case &#39;Infinity&#39;:
1059
- </span> <span class='comment'># return Infinity;
1060
- </span> <span class='comment'># case &#39;-Infinity&#39;:
1061
- </span> <span class='comment'># return -Infinity;
1062
- </span> <span class='comment'># default:
1063
- </span> <span class='comment'># throw new Error(&#39;Unsupported unserializable value: &#39; + remoteObject.unserializableValue);
1064
- </span> <span class='comment'># }
1065
- </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>unserializable_value is not implemented yet</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1066
- <span class='kw'>else</span>
1067
- <span class='ivar'>@value</span>
1068
- <span class='kw'>end</span>
1069
- <span class='kw'>end</span></pre>
1070
- </td>
1071
- </tr>
1072
- </table>
1073
- </div>
1074
-
1075
- </div>
1076
-
1077
- </div>
1078
-
1079
- <div id="footer">
1080
- Generated on Tue Jun 23 10:25:00 2020 by
1081
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1082
- 0.9.24 (ruby-2.6.3).
1083
- </div>
1084
-
1085
- </div>
1086
- </body>
1087
- </html>