puppeteer-ruby 0.0.13 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -14
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/.rubocop.yml +39 -3
  6. data/README.md +54 -1
  7. data/lib/puppeteer.rb +10 -2
  8. data/lib/puppeteer/browser.rb +53 -34
  9. data/lib/puppeteer/browser_context.rb +35 -5
  10. data/lib/puppeteer/cdp_session.rb +3 -19
  11. data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
  12. data/lib/puppeteer/connection.rb +9 -16
  13. data/lib/puppeteer/debug_print.rb +1 -1
  14. data/lib/puppeteer/define_async_method.rb +23 -0
  15. data/lib/puppeteer/dom_world.rb +84 -73
  16. data/lib/puppeteer/element_handle.rb +46 -63
  17. data/lib/puppeteer/emulation_manager.rb +2 -6
  18. data/lib/puppeteer/env.rb +18 -0
  19. data/lib/puppeteer/execution_context.rb +1 -6
  20. data/lib/puppeteer/frame.rb +46 -46
  21. data/lib/puppeteer/frame_manager.rb +7 -25
  22. data/lib/puppeteer/js_handle.rb +39 -38
  23. data/lib/puppeteer/keyboard.rb +9 -29
  24. data/lib/puppeteer/mouse.rb +20 -24
  25. data/lib/puppeteer/network_manager.rb +163 -5
  26. data/lib/puppeteer/page.rb +221 -181
  27. data/lib/puppeteer/page/pdf_options.rb +166 -0
  28. data/lib/puppeteer/remote_object.rb +18 -5
  29. data/lib/puppeteer/request.rb +330 -0
  30. data/lib/puppeteer/response.rb +113 -0
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +3 -5
  34. data/lib/puppeteer/web_socket.rb +7 -0
  35. data/puppeteer-ruby.gemspec +2 -1
  36. metadata +25 -103
  37. data/docs/Puppeteer.html +0 -2338
  38. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  39. data/docs/Puppeteer/Browser.html +0 -2258
  40. data/docs/Puppeteer/BrowserContext.html +0 -809
  41. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  42. data/docs/Puppeteer/BrowserRunner.html +0 -914
  43. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  44. data/docs/Puppeteer/CDPSession.html +0 -813
  45. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  46. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
  47. data/docs/Puppeteer/Connection.html +0 -964
  48. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  49. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  50. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  51. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  52. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  53. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  54. data/docs/Puppeteer/DOMWorld.html +0 -2293
  55. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  56. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  57. data/docs/Puppeteer/DebugPrint.html +0 -233
  58. data/docs/Puppeteer/Device.html +0 -470
  59. data/docs/Puppeteer/Devices.html +0 -139
  60. data/docs/Puppeteer/ElementHandle.html +0 -2542
  61. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  62. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  63. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  64. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  65. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  66. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  67. data/docs/Puppeteer/EmulationManager.html +0 -454
  68. data/docs/Puppeteer/EventCallbackable.html +0 -499
  69. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  70. data/docs/Puppeteer/ExecutionContext.html +0 -998
  71. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  72. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  73. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  74. data/docs/Puppeteer/FileChooser.html +0 -455
  75. data/docs/Puppeteer/Frame.html +0 -3835
  76. data/docs/Puppeteer/FrameManager.html +0 -2410
  77. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  78. data/docs/Puppeteer/IfPresent.html +0 -222
  79. data/docs/Puppeteer/JSHandle.html +0 -1352
  80. data/docs/Puppeteer/Keyboard.html +0 -1557
  81. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  82. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  83. data/docs/Puppeteer/Launcher.html +0 -237
  84. data/docs/Puppeteer/Launcher/Base.html +0 -385
  85. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  86. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  87. data/docs/Puppeteer/Launcher/Chrome.html +0 -674
  88. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  89. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  90. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  91. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  92. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  93. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  94. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  95. data/docs/Puppeteer/Mouse.html +0 -1095
  96. data/docs/Puppeteer/Mouse/Button.html +0 -136
  97. data/docs/Puppeteer/NetworkManager.html +0 -901
  98. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  99. data/docs/Puppeteer/Page.html +0 -6173
  100. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  101. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  102. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  103. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  104. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  105. data/docs/Puppeteer/RemoteObject.html +0 -1087
  106. data/docs/Puppeteer/Target.html +0 -1336
  107. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  108. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  109. data/docs/Puppeteer/TimeoutError.html +0 -135
  110. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  111. data/docs/Puppeteer/TouchScreen.html +0 -464
  112. data/docs/Puppeteer/Viewport.html +0 -837
  113. data/docs/Puppeteer/WaitTask.html +0 -637
  114. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  115. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  116. data/docs/Puppeteer/WebSocket.html +0 -673
  117. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  118. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  119. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  120. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  121. data/docs/_index.html +0 -816
  122. data/docs/class_list.html +0 -51
  123. data/docs/css/common.css +0 -1
  124. data/docs/css/full_list.css +0 -58
  125. data/docs/css/style.css +0 -496
  126. data/docs/file.README.html +0 -125
  127. data/docs/file_list.html +0 -56
  128. data/docs/frames.html +0 -17
  129. data/docs/index.html +0 -125
  130. data/docs/js/app.js +0 -314
  131. data/docs/js/full_list.js +0 -216
  132. data/docs/js/jquery.js +0 -4
  133. data/docs/method_list.html +0 -4123
  134. data/docs/top-level-namespace.html +0 -126
  135. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,105 +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
- Module: Puppeteer::AsyncAwaitBehavior
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::AsyncAwaitBehavior";
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 (A)</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">AsyncAwaitBehavior</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>Module: Puppeteer::AsyncAwaitBehavior
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
- <dl>
80
- <dt>Defined in:</dt>
81
- <dd>lib/puppeteer/async_await_behavior.rb</dd>
82
- </dl>
83
-
84
- </div>
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- </div>
96
-
97
- <div id="footer">
98
- Generated on Wed Jun 24 03:07:58 2020 by
99
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
- 0.9.24 (ruby-2.6.3).
101
- </div>
102
-
103
- </div>
104
- </body>
105
- </html>
@@ -1,2258 +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::Browser
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::Browser";
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 (B)</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">Browser</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::Browser
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::Browser</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>, <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span>, <span class='object_link'><a href="IfPresent.html" title="Puppeteer::IfPresent (module)">IfPresent</a></span></dd>
93
- </dl>
94
-
95
-
96
-
97
-
98
-
99
-
100
- <dl>
101
- <dt>Defined in:</dt>
102
- <dd>lib/puppeteer/browser.rb</dd>
103
- </dl>
104
-
105
- </div>
106
-
107
-
108
-
109
- <h2>
110
- Constant Summary
111
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
112
- </h2>
113
-
114
- <dl class="constants">
115
-
116
- <dt id="EVENT_MAPPINGS-constant" class="">EVENT_MAPPINGS =
117
-
118
- </dt>
119
- <dd><pre class="code"><span class='lbrace'>{</span>
120
- <span class='label'>disconnected:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.Disconnected</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
121
- <span class='label'>targetcreated:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetCreated</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
122
- <span class='label'>targetchanged:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetChanged</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
123
- <span class='label'>targetdestroyed:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetDestroyed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
124
- <span class='rbrace'>}</span></pre></dd>
125
-
126
- </dl>
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
- <h2>
137
- Class Method Summary
138
- <small><a href="#" class="summary_toggle">collapse</a></small>
139
- </h2>
140
-
141
- <ul class="summary">
142
-
143
- <li class="public ">
144
- <span class="summary_signature">
145
-
146
- <a href="#create-class_method" title="create (class method)">.<strong>create</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) &#x21d2; Object </a>
147
-
148
-
149
-
150
- </span>
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
- <span class="summary_desc"><div class='inline'></div></span>
161
-
162
- </li>
163
-
164
-
165
- </ul>
166
-
167
- <h2>
168
- Instance Method Summary
169
- <small><a href="#" class="summary_toggle">collapse</a></small>
170
- </h2>
171
-
172
- <ul class="summary">
173
-
174
- <li class="public ">
175
- <span class="summary_signature">
176
-
177
- <a href="#browser_contexts-instance_method" title="#browser_contexts (instance method)">#<strong>browser_contexts</strong> &#x21d2; Object </a>
178
-
179
-
180
-
181
- </span>
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
- <span class="summary_desc"><div class='inline'></div></span>
192
-
193
- </li>
194
-
195
-
196
- <li class="public ">
197
- <span class="summary_signature">
198
-
199
- <a href="#close-instance_method" title="#close (instance method)">#<strong>close</strong> &#x21d2; Object </a>
200
-
201
-
202
-
203
- </span>
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
- <span class="summary_desc"><div class='inline'></div></span>
214
-
215
- </li>
216
-
217
-
218
- <li class="public ">
219
- <span class="summary_signature">
220
-
221
- <a href="#connected%3F-instance_method" title="#connected? (instance method)">#<strong>connected?</strong> &#x21d2; Boolean </a>
222
-
223
-
224
-
225
- </span>
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
- <span class="summary_desc"><div class='inline'></div></span>
236
-
237
- </li>
238
-
239
-
240
- <li class="public ">
241
- <span class="summary_signature">
242
-
243
- <a href="#create_incognito_browser_context-instance_method" title="#create_incognito_browser_context (instance method)">#<strong>create_incognito_browser_context</strong> &#x21d2; Puppeteer::BrowserContext </a>
244
-
245
-
246
-
247
- </span>
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
- <span class="summary_desc"><div class='inline'></div></span>
258
-
259
- </li>
260
-
261
-
262
- <li class="public ">
263
- <span class="summary_signature">
264
-
265
- <a href="#create_page_in_context-instance_method" title="#create_page_in_context (instance method)">#<strong>create_page_in_context</strong>(context_id) &#x21d2; !Promise&lt;!Puppeteer.Page&gt; </a>
266
-
267
-
268
-
269
- </span>
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
- <span class="summary_desc"><div class='inline'></div></span>
280
-
281
- </li>
282
-
283
-
284
- <li class="public ">
285
- <span class="summary_signature">
286
-
287
- <a href="#default_browser_context-instance_method" title="#default_browser_context (instance method)">#<strong>default_browser_context</strong> &#x21d2; Puppeteer::BrowserContext </a>
288
-
289
-
290
-
291
- </span>
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
- <span class="summary_desc"><div class='inline'></div></span>
302
-
303
- </li>
304
-
305
-
306
- <li class="public ">
307
- <span class="summary_signature">
308
-
309
- <a href="#disconnect-instance_method" title="#disconnect (instance method)">#<strong>disconnect</strong> &#x21d2; Object </a>
310
-
311
-
312
-
313
- </span>
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
-
323
- <span class="summary_desc"><div class='inline'></div></span>
324
-
325
- </li>
326
-
327
-
328
- <li class="public ">
329
- <span class="summary_signature">
330
-
331
- <a href="#dispose_context-instance_method" title="#dispose_context (instance method)">#<strong>dispose_context</strong>(context_id) &#x21d2; Object </a>
332
-
333
-
334
-
335
- </span>
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
- <span class="summary_desc"><div class='inline'></div></span>
346
-
347
- </li>
348
-
349
-
350
- <li class="public ">
351
- <span class="summary_signature">
352
-
353
- <a href="#handle_target_created-instance_method" title="#handle_target_created (instance method)">#<strong>handle_target_created</strong>(event) &#x21d2; Object </a>
354
-
355
-
356
-
357
- </span>
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
- <span class="summary_desc"><div class='inline'></div></span>
368
-
369
- </li>
370
-
371
-
372
- <li class="public ">
373
- <span class="summary_signature">
374
-
375
- <a href="#handle_target_destroyed-instance_method" title="#handle_target_destroyed (instance method)">#<strong>handle_target_destroyed</strong>(event) &#x21d2; Object </a>
376
-
377
-
378
-
379
- </span>
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
- <span class="summary_desc"><div class='inline'></div></span>
390
-
391
- </li>
392
-
393
-
394
- <li class="public ">
395
- <span class="summary_signature">
396
-
397
- <a href="#handle_target_info_changed-instance_method" title="#handle_target_info_changed (instance method)">#<strong>handle_target_info_changed</strong>(event) &#x21d2; Object </a>
398
-
399
-
400
-
401
- </span>
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
- <span class="summary_desc"><div class='inline'></div></span>
412
-
413
- </li>
414
-
415
-
416
- <li class="public ">
417
- <span class="summary_signature">
418
-
419
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) &#x21d2; Browser </a>
420
-
421
-
422
-
423
- </span>
424
-
425
-
426
- <span class="note title constructor">constructor</span>
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
- <span class="summary_desc"><div class='inline'>
436
- <p>A new instance of Browser.</p>
437
- </div></span>
438
-
439
- </li>
440
-
441
-
442
- <li class="public ">
443
- <span class="summary_signature">
444
-
445
- <a href="#new_page-instance_method" title="#new_page (instance method)">#<strong>new_page</strong> &#x21d2; Object </a>
446
-
447
-
448
-
449
- </span>
450
-
451
-
452
-
453
-
454
-
455
-
456
-
457
-
458
-
459
- <span class="summary_desc"><div class='inline'></div></span>
460
-
461
- </li>
462
-
463
-
464
- <li class="public ">
465
- <span class="summary_signature">
466
-
467
- <a href="#on-instance_method" title="#on (instance method)">#<strong>on</strong>(event_name, &amp;block) &#x21d2; Object </a>
468
-
469
-
470
-
471
- </span>
472
-
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
- <span class="summary_desc"><div class='inline'></div></span>
482
-
483
- </li>
484
-
485
-
486
- <li class="public ">
487
- <span class="summary_signature">
488
-
489
- <a href="#pages-instance_method" title="#pages (instance method)">#<strong>pages</strong> &#x21d2; !Promise&lt;!Array&lt;!Puppeteer.Page&gt;&gt; </a>
490
-
491
-
492
-
493
- </span>
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
-
503
- <span class="summary_desc"><div class='inline'></div></span>
504
-
505
- </li>
506
-
507
-
508
- <li class="public ">
509
- <span class="summary_signature">
510
-
511
- <a href="#process-instance_method" title="#process (instance method)">#<strong>process</strong> &#x21d2; Puppeteer::BrowserRunner::BrowserProcess </a>
512
-
513
-
514
-
515
- </span>
516
-
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
- <span class="summary_desc"><div class='inline'></div></span>
526
-
527
- </li>
528
-
529
-
530
- <li class="public ">
531
- <span class="summary_signature">
532
-
533
- <a href="#target-instance_method" title="#target (instance method)">#<strong>target</strong> &#x21d2; !Target </a>
534
-
535
-
536
-
537
- </span>
538
-
539
-
540
-
541
-
542
-
543
-
544
-
545
-
546
-
547
- <span class="summary_desc"><div class='inline'></div></span>
548
-
549
- </li>
550
-
551
-
552
- <li class="public ">
553
- <span class="summary_signature">
554
-
555
- <a href="#targets-instance_method" title="#targets (instance method)">#<strong>targets</strong> &#x21d2; !Array&lt;!Target&gt; </a>
556
-
557
-
558
-
559
- </span>
560
-
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
-
569
- <span class="summary_desc"><div class='inline'></div></span>
570
-
571
- </li>
572
-
573
-
574
- <li class="public ">
575
- <span class="summary_signature">
576
-
577
- <a href="#user_agent-instance_method" title="#user_agent (instance method)">#<strong>user_agent</strong> &#x21d2; String </a>
578
-
579
-
580
-
581
- </span>
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
-
591
- <span class="summary_desc"><div class='inline'></div></span>
592
-
593
- </li>
594
-
595
-
596
- <li class="public ">
597
- <span class="summary_signature">
598
-
599
- <a href="#version-instance_method" title="#version (instance method)">#<strong>version</strong> &#x21d2; String </a>
600
-
601
-
602
-
603
- </span>
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
- <span class="summary_desc"><div class='inline'></div></span>
614
-
615
- </li>
616
-
617
-
618
- <li class="public ">
619
- <span class="summary_signature">
620
-
621
- <a href="#wait_for_target-instance_method" title="#wait_for_target (instance method)">#<strong>wait_for_target</strong>(predicate:, timeout: nil) &#x21d2; !Promise&lt;!Target&gt; </a>
622
-
623
-
624
-
625
- </span>
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
- <span class="summary_desc"><div class='inline'></div></span>
636
-
637
- </li>
638
-
639
-
640
- <li class="public ">
641
- <span class="summary_signature">
642
-
643
- <a href="#websocket_endpoint-instance_method" title="#websocket_endpoint (instance method)">#<strong>websocket_endpoint</strong> &#x21d2; String </a>
644
-
645
-
646
-
647
- </span>
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
-
656
-
657
- <span class="summary_desc"><div class='inline'></div></span>
658
-
659
- </li>
660
-
661
-
662
- </ul>
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
- <h3 class="inherited">Methods included from <span class='object_link'><a href="IfPresent.html" title="Puppeteer::IfPresent (module)">IfPresent</a></span></h3>
675
- <p class="inherited"><span class='object_link'><a href="IfPresent.html#if_present-instance_method" title="Puppeteer::IfPresent#if_present (method)">#if_present</a></span></p>
676
-
677
-
678
-
679
-
680
-
681
-
682
-
683
-
684
-
685
- <h3 class="inherited">Methods included from <span class='object_link'><a href="EventCallbackable.html" title="Puppeteer::EventCallbackable (module)">EventCallbackable</a></span></h3>
686
- <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#observe_first-instance_method" title="Puppeteer::EventCallbackable#observe_first (method)">#observe_first</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>
687
-
688
-
689
-
690
-
691
-
692
-
693
-
694
-
695
-
696
- <h3 class="inherited">Methods included from <span class='object_link'><a href="DebugPrint.html" title="Puppeteer::DebugPrint (module)">DebugPrint</a></span></h3>
697
- <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>
698
- <div id="constructor_details" class="method_details_list">
699
- <h2>Constructor Details</h2>
700
-
701
- <div class="method_details first">
702
- <h3 class="signature first" id="initialize-instance_method">
703
-
704
- #<strong>initialize</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::Browser (class)">Browser</a></span></tt>
705
-
706
-
707
-
708
-
709
-
710
- </h3><div class="docstring">
711
- <div class="discussion">
712
-
713
- <p>Returns a new instance of Browser.</p>
714
-
715
-
716
- </div>
717
- </div>
718
- <div class="tags">
719
- <p class="tag_title">Parameters:</p>
720
- <ul class="param">
721
-
722
- <li>
723
-
724
- <span class='name'>connection</span>
725
-
726
-
727
- <span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></tt>)</span>
728
-
729
-
730
-
731
- </li>
732
-
733
- <li>
734
-
735
- <span class='name'>contextIds</span>
736
-
737
-
738
- <span class='type'>(<tt>!Array&lt;string&gt;</tt>)</span>
739
-
740
-
741
-
742
- </li>
743
-
744
- <li>
745
-
746
- <span class='name'>ignoreHTTPSErrors</span>
747
-
748
-
749
- <span class='type'>(<tt>boolean</tt>)</span>
750
-
751
-
752
-
753
- </li>
754
-
755
- <li>
756
-
757
- <span class='name'>defaultViewport</span>
758
-
759
-
760
- <span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span></tt>)</span>
761
-
762
-
763
-
764
- </li>
765
-
766
- <li>
767
-
768
- <span class='name'>process</span>
769
-
770
-
771
- <span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.ChildProcess</tt>)</span>
772
-
773
-
774
-
775
- </li>
776
-
777
- <li>
778
-
779
- <span class='name'>closeCallback</span>
780
-
781
-
782
- <span class='type'>(<tt>(function():Promise)=</tt>)</span>
783
-
784
-
785
-
786
- </li>
787
-
788
- </ul>
789
-
790
-
791
- </div><table class="source_code">
792
- <tr>
793
- <td>
794
- <pre class="lines">
795
-
796
-
797
- 35
798
- 36
799
- 37
800
- 38
801
- 39
802
- 40
803
- 41
804
- 42
805
- 43
806
- 44
807
- 45
808
- 46
809
- 47
810
- 48
811
- 49
812
- 50
813
- 51
814
- 52
815
- 53
816
- 54
817
- 55</pre>
818
- </td>
819
- <td>
820
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 35</span>
821
-
822
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>connection:</span><span class='comma'>,</span> <span class='label'>context_ids:</span><span class='comma'>,</span> <span class='label'>ignore_https_errors:</span><span class='comma'>,</span> <span class='label'>default_viewport:</span><span class='comma'>,</span> <span class='label'>process:</span><span class='comma'>,</span> <span class='label'>close_callback:</span><span class='rparen'>)</span>
823
- <span class='ivar'>@ignore_https_errors</span> <span class='op'>=</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span>
824
- <span class='ivar'>@default_viewport</span> <span class='op'>=</span> <span class='id identifier rubyid_default_viewport'>default_viewport</span>
825
- <span class='ivar'>@process</span> <span class='op'>=</span> <span class='id identifier rubyid_process'>process</span>
826
- <span class='comment'># @screenshot_task_queue = TaskQueue.new
827
- </span> <span class='ivar'>@connection</span> <span class='op'>=</span> <span class='id identifier rubyid_connection'>connection</span>
828
- <span class='ivar'>@close_callback</span> <span class='op'>=</span> <span class='id identifier rubyid_close_callback'>close_callback</span>
829
-
830
- <span class='ivar'>@default_context</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="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
831
- <span class='ivar'>@contexts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
832
- <span class='id identifier rubyid_context_ids'>context_ids</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_context_id'>context_id</span><span class='op'>|</span>
833
- <span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_context_id'>context_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="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span> <span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
834
- <span class='kw'>end</span>
835
- <span class='ivar'>@targets</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
836
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Connection.Disconnected</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</span>
837
- <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.Disconnected</span><span class='tstring_end'>&#39;</span></span>
838
- <span class='kw'>end</span>
839
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Target.targetCreated</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_created</span><span class='rparen'>)</span>
840
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Target.targetDestroyed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_destroyed</span><span class='rparen'>)</span>
841
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_on_event'>on_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Target.targetInfoChanged</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_method'>method</span><span class='lparen'>(</span><span class='symbol'>:handle_target_info_changed</span><span class='rparen'>)</span>
842
- <span class='kw'>end</span></pre>
843
- </td>
844
- </tr>
845
- </table>
846
- </div>
847
-
848
- </div>
849
-
850
-
851
- <div id="class_method_details" class="method_details_list">
852
- <h2>Class Method Details</h2>
853
-
854
-
855
- <div class="method_details first">
856
- <h3 class="signature first" id="create-class_method">
857
-
858
- .<strong>create</strong>(connection:, context_ids:, ignore_https_errors:, default_viewport:, process:, close_callback:) &#x21d2; <tt>Object</tt>
859
-
860
-
861
-
862
-
863
-
864
- </h3><div class="docstring">
865
- <div class="discussion">
866
-
867
-
868
- </div>
869
- </div>
870
- <div class="tags">
871
- <p class="tag_title">Parameters:</p>
872
- <ul class="param">
873
-
874
- <li>
875
-
876
- <span class='name'>connection</span>
877
-
878
-
879
- <span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Connection.html" title="Puppeteer::Connection (class)">Connection</a></span></tt>)</span>
880
-
881
-
882
-
883
- </li>
884
-
885
- <li>
886
-
887
- <span class='name'>contextIds</span>
888
-
889
-
890
- <span class='type'>(<tt>!Array&lt;string&gt;</tt>)</span>
891
-
892
-
893
-
894
- </li>
895
-
896
- <li>
897
-
898
- <span class='name'>ignoreHTTPSErrors</span>
899
-
900
-
901
- <span class='type'>(<tt>boolean</tt>)</span>
902
-
903
-
904
-
905
- </li>
906
-
907
- <li>
908
-
909
- <span class='name'>defaultViewport</span>
910
-
911
-
912
- <span class='type'>(<tt>?<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span></tt>)</span>
913
-
914
-
915
-
916
- </li>
917
-
918
- <li>
919
-
920
- <span class='name'>process</span>
921
-
922
-
923
- <span class='type'>(<tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span>|NilClass</tt>)</span>
924
-
925
-
926
-
927
- </li>
928
-
929
- <li>
930
-
931
- <span class='name'>closeCallback</span>
932
-
933
-
934
- <span class='type'>(<tt>function()=</tt>)</span>
935
-
936
-
937
-
938
- </li>
939
-
940
- </ul>
941
-
942
-
943
- </div><table class="source_code">
944
- <tr>
945
- <td>
946
- <pre class="lines">
947
-
948
-
949
- 16
950
- 17
951
- 18
952
- 19
953
- 20
954
- 21
955
- 22
956
- 23
957
- 24
958
- 25
959
- 26
960
- 27</pre>
961
- </td>
962
- <td>
963
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 16</span>
964
-
965
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='label'>connection:</span><span class='comma'>,</span> <span class='label'>context_ids:</span><span class='comma'>,</span> <span class='label'>ignore_https_errors:</span><span class='comma'>,</span> <span class='label'>default_viewport:</span><span class='comma'>,</span> <span class='label'>process:</span><span class='comma'>,</span> <span class='label'>close_callback:</span><span class='rparen'>)</span>
966
- <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="" title="Puppeteer::Browser (class)">Browser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer::Browser#initialize (method)">new</a></span></span><span class='lparen'>(</span>
967
- <span class='label'>connection:</span> <span class='id identifier rubyid_connection'>connection</span><span class='comma'>,</span>
968
- <span class='label'>context_ids:</span> <span class='id identifier rubyid_context_ids'>context_ids</span><span class='comma'>,</span>
969
- <span class='label'>ignore_https_errors:</span> <span class='id identifier rubyid_ignore_https_errors'>ignore_https_errors</span><span class='comma'>,</span>
970
- <span class='label'>default_viewport:</span> <span class='id identifier rubyid_default_viewport'>default_viewport</span><span class='comma'>,</span>
971
- <span class='label'>process:</span> <span class='id identifier rubyid_process'>process</span><span class='comma'>,</span>
972
- <span class='label'>close_callback:</span> <span class='id identifier rubyid_close_callback'>close_callback</span><span class='comma'>,</span>
973
- <span class='rparen'>)</span>
974
- <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.setDiscoverTargets</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>discover:</span> <span class='kw'>true</span><span class='rparen'>)</span>
975
- <span class='id identifier rubyid_browser'>browser</span>
976
- <span class='kw'>end</span></pre>
977
- </td>
978
- </tr>
979
- </table>
980
- </div>
981
-
982
- </div>
983
-
984
- <div id="instance_method_details" class="method_details_list">
985
- <h2>Instance Method Details</h2>
986
-
987
-
988
- <div class="method_details first">
989
- <h3 class="signature first" id="browser_contexts-instance_method">
990
-
991
- #<strong>browser_contexts</strong> &#x21d2; <tt>Object</tt>
992
-
993
-
994
-
995
-
996
-
997
- </h3><table class="source_code">
998
- <tr>
999
- <td>
1000
- <pre class="lines">
1001
-
1002
-
1003
- 85
1004
- 86
1005
- 87</pre>
1006
- </td>
1007
- <td>
1008
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 85</span>
1009
-
1010
- <span class='kw'>def</span> <span class='id identifier rubyid_browser_contexts'>browser_contexts</span>
1011
- <span class='lbracket'>[</span><span class='ivar'>@default_context</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_concat'>concat</span><span class='lparen'>(</span><span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='rparen'>)</span>
1012
- <span class='kw'>end</span></pre>
1013
- </td>
1014
- </tr>
1015
- </table>
1016
- </div>
1017
-
1018
- <div class="method_details ">
1019
- <h3 class="signature " id="close-instance_method">
1020
-
1021
- #<strong>close</strong> &#x21d2; <tt>Object</tt>
1022
-
1023
-
1024
-
1025
-
1026
-
1027
- </h3><table class="source_code">
1028
- <tr>
1029
- <td>
1030
- <pre class="lines">
1031
-
1032
-
1033
- 264
1034
- 265
1035
- 266
1036
- 267</pre>
1037
- </td>
1038
- <td>
1039
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 264</span>
1040
-
1041
- <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
1042
- <span class='ivar'>@close_callback</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
1043
- <span class='id identifier rubyid_disconnect'>disconnect</span>
1044
- <span class='kw'>end</span></pre>
1045
- </td>
1046
- </tr>
1047
- </table>
1048
- </div>
1049
-
1050
- <div class="method_details ">
1051
- <h3 class="signature " id="connected?-instance_method">
1052
-
1053
- #<strong>connected?</strong> &#x21d2; <tt>Boolean</tt>
1054
-
1055
-
1056
-
1057
-
1058
-
1059
- </h3><div class="docstring">
1060
- <div class="discussion">
1061
-
1062
-
1063
- </div>
1064
- </div>
1065
- <div class="tags">
1066
-
1067
- <p class="tag_title">Returns:</p>
1068
- <ul class="return">
1069
-
1070
- <li>
1071
-
1072
-
1073
- <span class='type'>(<tt>Boolean</tt>)</span>
1074
-
1075
-
1076
-
1077
- </li>
1078
-
1079
- </ul>
1080
-
1081
- </div><table class="source_code">
1082
- <tr>
1083
- <td>
1084
- <pre class="lines">
1085
-
1086
-
1087
- 273
1088
- 274
1089
- 275</pre>
1090
- </td>
1091
- <td>
1092
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 273</span>
1093
-
1094
- <span class='kw'>def</span> <span class='id identifier rubyid_connected?'>connected?</span>
1095
- <span class='op'>!</span><span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
1096
- <span class='kw'>end</span></pre>
1097
- </td>
1098
- </tr>
1099
- </table>
1100
- </div>
1101
-
1102
- <div class="method_details ">
1103
- <h3 class="signature " id="create_incognito_browser_context-instance_method">
1104
-
1105
- #<strong>create_incognito_browser_context</strong> &#x21d2; <tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>
1106
-
1107
-
1108
-
1109
-
1110
-
1111
- </h3><div class="docstring">
1112
- <div class="discussion">
1113
-
1114
-
1115
- </div>
1116
- </div>
1117
- <div class="tags">
1118
-
1119
- <p class="tag_title">Returns:</p>
1120
- <ul class="return">
1121
-
1122
- <li>
1123
-
1124
-
1125
- <span class='type'>(<tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>)</span>
1126
-
1127
-
1128
-
1129
- </li>
1130
-
1131
- </ul>
1132
-
1133
- </div><table class="source_code">
1134
- <tr>
1135
- <td>
1136
- <pre class="lines">
1137
-
1138
-
1139
- 79
1140
- 80
1141
- 81
1142
- 82
1143
- 83</pre>
1144
- </td>
1145
- <td>
1146
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 79</span>
1147
-
1148
- <span class='kw'>def</span> <span class='id identifier rubyid_create_incognito_browser_context'>create_incognito_browser_context</span>
1149
- <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <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.createBrowserContext</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1150
- <span class='id identifier rubyid_browser_context_id'>browser_context_id</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'>browserContextId</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1151
- <span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_browser_context_id'>browser_context_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="BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BrowserContext.html#initialize-instance_method" title="Puppeteer::BrowserContext#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@connection</span><span class='comma'>,</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rparen'>)</span>
1152
- <span class='kw'>end</span></pre>
1153
- </td>
1154
- </tr>
1155
- </table>
1156
- </div>
1157
-
1158
- <div class="method_details ">
1159
- <h3 class="signature " id="create_page_in_context-instance_method">
1160
-
1161
- #<strong>create_page_in_context</strong>(context_id) &#x21d2; <tt>!Promise&lt;!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>&gt;</tt>
1162
-
1163
-
1164
-
1165
-
1166
-
1167
- </h3><div class="docstring">
1168
- <div class="discussion">
1169
-
1170
-
1171
- </div>
1172
- </div>
1173
- <div class="tags">
1174
- <p class="tag_title">Parameters:</p>
1175
- <ul class="param">
1176
-
1177
- <li>
1178
-
1179
- <span class='name'>contextId</span>
1180
-
1181
-
1182
- <span class='type'>(<tt>?string</tt>)</span>
1183
-
1184
-
1185
-
1186
- </li>
1187
-
1188
- </ul>
1189
-
1190
- <p class="tag_title">Returns:</p>
1191
- <ul class="return">
1192
-
1193
- <li>
1194
-
1195
-
1196
- <span class='type'>(<tt>!Promise&lt;!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>&gt;</tt>)</span>
1197
-
1198
-
1199
-
1200
- </li>
1201
-
1202
- </ul>
1203
-
1204
- </div><table class="source_code">
1205
- <tr>
1206
- <td>
1207
- <pre class="lines">
1208
-
1209
-
1210
- 187
1211
- 188
1212
- 189
1213
- 190
1214
- 191
1215
- 192
1216
- 193
1217
- 194
1218
- 195
1219
- 196
1220
- 197</pre>
1221
- </td>
1222
- <td>
1223
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 187</span>
1224
-
1225
- <span class='kw'>def</span> <span class='id identifier rubyid_create_page_in_context'>create_page_in_context</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
1226
- <span class='id identifier rubyid_create_target_params'>create_target_params</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>url:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>about:blank</span><span class='tstring_end'>&#39;</span></span> <span class='rbrace'>}</span>
1227
- <span class='kw'>if</span> <span class='id identifier rubyid_context_id'>context_id</span>
1228
- <span class='id identifier rubyid_create_target_params'>create_target_params</span><span class='lbracket'>[</span><span class='symbol'>:browserContextId</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_context_id'>context_id</span>
1229
- <span class='kw'>end</span>
1230
- <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <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.createTarget</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_create_target_params'>create_target_params</span><span class='rparen'>)</span>
1231
- <span class='id identifier rubyid_target_id'>target_id</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'>targetId</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1232
- <span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
1233
- <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_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized_promise'>initialized_promise</span>
1234
- <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_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_page'>page</span>
1235
- <span class='kw'>end</span></pre>
1236
- </td>
1237
- </tr>
1238
- </table>
1239
- </div>
1240
-
1241
- <div class="method_details ">
1242
- <h3 class="signature " id="default_browser_context-instance_method">
1243
-
1244
- #<strong>default_browser_context</strong> &#x21d2; <tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>
1245
-
1246
-
1247
-
1248
-
1249
-
1250
- </h3><div class="docstring">
1251
- <div class="discussion">
1252
-
1253
-
1254
- </div>
1255
- </div>
1256
- <div class="tags">
1257
-
1258
- <p class="tag_title">Returns:</p>
1259
- <ul class="return">
1260
-
1261
- <li>
1262
-
1263
-
1264
- <span class='type'>(<tt><span class='object_link'><a href="BrowserContext.html" title="Puppeteer::BrowserContext (class)">Puppeteer::BrowserContext</a></span></tt>)</span>
1265
-
1266
-
1267
-
1268
- </li>
1269
-
1270
- </ul>
1271
-
1272
- </div><table class="source_code">
1273
- <tr>
1274
- <td>
1275
- <pre class="lines">
1276
-
1277
-
1278
- 90
1279
- 91
1280
- 92</pre>
1281
- </td>
1282
- <td>
1283
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 90</span>
1284
-
1285
- <span class='kw'>def</span> <span class='id identifier rubyid_default_browser_context'>default_browser_context</span>
1286
- <span class='ivar'>@default_context</span>
1287
- <span class='kw'>end</span></pre>
1288
- </td>
1289
- </tr>
1290
- </table>
1291
- </div>
1292
-
1293
- <div class="method_details ">
1294
- <h3 class="signature " id="disconnect-instance_method">
1295
-
1296
- #<strong>disconnect</strong> &#x21d2; <tt>Object</tt>
1297
-
1298
-
1299
-
1300
-
1301
-
1302
- </h3><table class="source_code">
1303
- <tr>
1304
- <td>
1305
- <pre class="lines">
1306
-
1307
-
1308
- 269
1309
- 270
1310
- 271</pre>
1311
- </td>
1312
- <td>
1313
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 269</span>
1314
-
1315
- <span class='kw'>def</span> <span class='id identifier rubyid_disconnect'>disconnect</span>
1316
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_dispose'>dispose</span>
1317
- <span class='kw'>end</span></pre>
1318
- </td>
1319
- </tr>
1320
- </table>
1321
- </div>
1322
-
1323
- <div class="method_details ">
1324
- <h3 class="signature " id="dispose_context-instance_method">
1325
-
1326
- #<strong>dispose_context</strong>(context_id) &#x21d2; <tt>Object</tt>
1327
-
1328
-
1329
-
1330
-
1331
-
1332
- </h3><div class="docstring">
1333
- <div class="discussion">
1334
-
1335
-
1336
- </div>
1337
- </div>
1338
- <div class="tags">
1339
- <p class="tag_title">Parameters:</p>
1340
- <ul class="param">
1341
-
1342
- <li>
1343
-
1344
- <span class='name'>context_id</span>
1345
-
1346
-
1347
- <span class='type'>(<tt>String</tt>)</span>
1348
-
1349
-
1350
-
1351
- </li>
1352
-
1353
- </ul>
1354
-
1355
-
1356
- </div><table class="source_code">
1357
- <tr>
1358
- <td>
1359
- <pre class="lines">
1360
-
1361
-
1362
- 95
1363
- 96
1364
- 97
1365
- 98</pre>
1366
- </td>
1367
- <td>
1368
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 95</span>
1369
-
1370
- <span class='kw'>def</span> <span class='id identifier rubyid_dispose_context'>dispose_context</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
1371
- <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.disposeBrowserContext</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>browserContextId:</span> <span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
1372
- <span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_context_id'>context_id</span><span class='rparen'>)</span>
1373
- <span class='kw'>end</span></pre>
1374
- </td>
1375
- </tr>
1376
- </table>
1377
- </div>
1378
-
1379
- <div class="method_details ">
1380
- <h3 class="signature " id="handle_target_created-instance_method">
1381
-
1382
- #<strong>handle_target_created</strong>(event) &#x21d2; <tt>Object</tt>
1383
-
1384
-
1385
-
1386
-
1387
-
1388
- </h3><div class="docstring">
1389
- <div class="discussion">
1390
-
1391
-
1392
- </div>
1393
- </div>
1394
- <div class="tags">
1395
- <p class="tag_title">Parameters:</p>
1396
- <ul class="param">
1397
-
1398
- <li>
1399
-
1400
- <span class='name'>event</span>
1401
-
1402
-
1403
- <span class='type'>(<tt>!Protocol.<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>.targetCreatedPayload</tt>)</span>
1404
-
1405
-
1406
-
1407
- </li>
1408
-
1409
- </ul>
1410
-
1411
-
1412
- </div><table class="source_code">
1413
- <tr>
1414
- <td>
1415
- <pre class="lines">
1416
-
1417
-
1418
- 101
1419
- 102
1420
- 103
1421
- 104
1422
- 105
1423
- 106
1424
- 107
1425
- 108
1426
- 109
1427
- 110
1428
- 111
1429
- 112
1430
- 113
1431
- 114
1432
- 115
1433
- 116
1434
- 117
1435
- 118
1436
- 119
1437
- 120
1438
- 121
1439
- 122
1440
- 123
1441
- 124
1442
- 125
1443
- 126
1444
- 127
1445
- 128
1446
- 129</pre>
1447
- </td>
1448
- <td>
1449
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 101</span>
1450
-
1451
- <span class='kw'>def</span> <span class='id identifier rubyid_handle_target_created'>handle_target_created</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
1452
- <span class='id identifier rubyid_target_info'>target_info</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="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target/TargetInfo.html" title="Puppeteer::Target::TargetInfo (class)">TargetInfo</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target/TargetInfo.html#initialize-instance_method" title="Puppeteer::Target::TargetInfo#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>targetInfo</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1453
- <span class='id identifier rubyid_browser_context_id'>browser_context_id</span> <span class='op'>=</span> <span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span>
1454
- <span class='id identifier rubyid_context'>context</span> <span class='op'>=</span>
1455
- <span class='kw'>if</span> <span class='id identifier rubyid_browser_context_id'>browser_context_id</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@contexts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rparen'>)</span>
1456
- <span class='ivar'>@contexts</span><span class='lbracket'>[</span><span class='id identifier rubyid_browser_context_id'>browser_context_id</span><span class='rbracket'>]</span>
1457
- <span class='kw'>else</span>
1458
- <span class='ivar'>@default_context</span>
1459
- <span class='kw'>end</span>
1460
-
1461
- <span class='id identifier rubyid_target'>target</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="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target.html#initialize-instance_method" title="Puppeteer::Target#initialize (method)">new</a></span></span><span class='lparen'>(</span>
1462
- <span class='label'>target_info:</span> <span class='id identifier rubyid_target_info'>target_info</span><span class='comma'>,</span>
1463
- <span class='label'>browser_context:</span> <span class='id identifier rubyid_context'>context</span><span class='comma'>,</span>
1464
- <span class='label'>session_factory:</span> <span class='tlambda'>-&gt;</span> <span class='tlambeg'>{</span> <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_create_session'>create_session</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
1465
- <span class='label'>ignore_https_errors:</span> <span class='ivar'>@ignore_https_errors</span><span class='comma'>,</span>
1466
- <span class='label'>default_viewport:</span> <span class='ivar'>@default_viewport</span><span class='comma'>,</span>
1467
- <span class='label'>screenshot_task_queue:</span> <span class='ivar'>@screenshot_task_queue</span><span class='comma'>,</span>
1468
- <span class='rparen'>)</span>
1469
- <span class='comment'># assert(!this._targets.has(event.targetInfo.targetId), &#39;Target should not exist before targetCreated&#39;);
1470
- </span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
1471
- <span class='kw'>if</span> <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_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized_promise'>initialized_promise</span>
1472
- <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetCreated</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1473
- <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.BrowserContext.TargetCreated</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1474
- <span class='kw'>end</span>
1475
-
1476
- <span class='id identifier rubyid_if_present'>if_present</span><span class='lparen'>(</span><span class='id identifier rubyid_pending_target_info_changed_event'>pending_target_info_changed_event</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pending_event'>pending_event</span><span class='op'>|</span>
1477
- <span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_pending_event'>pending_event</span><span class='rparen'>)</span>
1478
- <span class='kw'>end</span>
1479
- <span class='kw'>end</span></pre>
1480
- </td>
1481
- </tr>
1482
- </table>
1483
- </div>
1484
-
1485
- <div class="method_details ">
1486
- <h3 class="signature " id="handle_target_destroyed-instance_method">
1487
-
1488
- #<strong>handle_target_destroyed</strong>(event) &#x21d2; <tt>Object</tt>
1489
-
1490
-
1491
-
1492
-
1493
-
1494
- </h3><div class="docstring">
1495
- <div class="discussion">
1496
-
1497
-
1498
- </div>
1499
- </div>
1500
- <div class="tags">
1501
- <p class="tag_title">Parameters:</p>
1502
- <ul class="param">
1503
-
1504
- <li>
1505
-
1506
- <span class='name'>event</span>
1507
-
1508
-
1509
- <span class='type'>(<tt>{targetId: string}</tt>)</span>
1510
-
1511
-
1512
-
1513
- </li>
1514
-
1515
- </ul>
1516
-
1517
-
1518
- </div><table class="source_code">
1519
- <tr>
1520
- <td>
1521
- <pre class="lines">
1522
-
1523
-
1524
- 133
1525
- 134
1526
- 135
1527
- 136
1528
- 137
1529
- 138
1530
- 139
1531
- 140
1532
- 141
1533
- 142
1534
- 143</pre>
1535
- </td>
1536
- <td>
1537
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 133</span>
1538
-
1539
- <span class='kw'>def</span> <span class='id identifier rubyid_handle_target_destroyed'>handle_target_destroyed</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
1540
- <span class='id identifier rubyid_target_id'>target_id</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>targetId</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
1541
- <span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
1542
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_ignore_initialize_callback_promise'>ignore_initialize_callback_promise</span>
1543
- <span class='ivar'>@targets</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rparen'>)</span>
1544
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_closed_callback'>closed_callback</span>
1545
- <span class='kw'>if</span> <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_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized_promise'>initialized_promise</span>
1546
- <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetDestroyed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1547
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_browser_context'>browser_context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.BrowserContext.TargetDestroyed</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1548
- <span class='kw'>end</span>
1549
- <span class='kw'>end</span></pre>
1550
- </td>
1551
- </tr>
1552
- </table>
1553
- </div>
1554
-
1555
- <div class="method_details ">
1556
- <h3 class="signature " id="handle_target_info_changed-instance_method">
1557
-
1558
- #<strong>handle_target_info_changed</strong>(event) &#x21d2; <tt>Object</tt>
1559
-
1560
-
1561
-
1562
-
1563
-
1564
- </h3><div class="docstring">
1565
- <div class="discussion">
1566
-
1567
-
1568
- </div>
1569
- </div>
1570
- <div class="tags">
1571
- <p class="tag_title">Parameters:</p>
1572
- <ul class="param">
1573
-
1574
- <li>
1575
-
1576
- <span class='name'>event</span>
1577
-
1578
-
1579
- <span class='type'>(<tt>!Protocol.<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>.targetInfoChangedPayload</tt>)</span>
1580
-
1581
-
1582
-
1583
- </li>
1584
-
1585
- </ul>
1586
-
1587
-
1588
- </div><table class="source_code">
1589
- <tr>
1590
- <td>
1591
- <pre class="lines">
1592
-
1593
-
1594
- 146
1595
- 147
1596
- 148
1597
- 149
1598
- 150
1599
- 151
1600
- 152
1601
- 153
1602
- 154
1603
- 155
1604
- 156
1605
- 157
1606
- 158
1607
- 159
1608
- 160
1609
- 161
1610
- 162
1611
- 163
1612
- 164
1613
- 165
1614
- 166
1615
- 167
1616
- 168
1617
- 169
1618
- 170</pre>
1619
- </td>
1620
- <td>
1621
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 146</span>
1622
-
1623
- <span class='kw'>def</span> <span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='rparen'>)</span>
1624
- <span class='id identifier rubyid_target_info'>target_info</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="Target.html" title="Puppeteer::Target (class)">Target</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Target/TargetInfo.html" title="Puppeteer::Target::TargetInfo (class)">TargetInfo</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Target/TargetInfo.html#initialize-instance_method" title="Puppeteer::Target::TargetInfo#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>targetInfo</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
1625
- <span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='ivar'>@targets</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span>
1626
- <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_target'>target</span>
1627
- <span class='comment'># targetCreated is sometimes notified after targetInfoChanged.
1628
- </span> <span class='comment'># We don&#39;t raise error. Instead, keep the event as a pending change,
1629
- </span> <span class='comment'># and handle it on handle_target_created.
1630
- </span> <span class='comment'>#
1631
- </span> <span class='comment'># D, [2020-04-22T00:22:26.630328 #79646] DEBUG -- : RECV &lt;&lt; {&quot;method&quot;=&gt;&quot;Target.targetInfoChanged&quot;, &quot;params&quot;=&gt;{&quot;targetInfo&quot;=&gt;{&quot;targetId&quot;=&gt;&quot;8068CED48357B9557EEC85AA62165A8E&quot;, &quot;type&quot;=&gt;&quot;iframe&quot;, &quot;title&quot;=&gt;&quot;&quot;, &quot;url&quot;=&gt;&quot;&quot;, &quot;attached&quot;=&gt;true, &quot;browserContextId&quot;=&gt;&quot;7895BFB24BF22CE40584808713D96E8D&quot;}}}
1632
- </span> <span class='comment'># E, [2020-04-22T00:22:26.630448 #79646] ERROR -- : target should exist before targetInfoChanged (StandardError)
1633
- </span> <span class='comment'># D, [2020-04-22T00:22:26.630648 #79646] DEBUG -- : RECV &lt;&lt; {&quot;method&quot;=&gt;&quot;Target.targetCreated&quot;, &quot;params&quot;=&gt;{&quot;targetInfo&quot;=&gt;{&quot;targetId&quot;=&gt;&quot;8068CED48357B9557EEC85AA62165A8E&quot;, &quot;type&quot;=&gt;&quot;iframe&quot;, &quot;title&quot;=&gt;&quot;&quot;, &quot;url&quot;=&gt;&quot;&quot;, &quot;attached&quot;=&gt;false, &quot;browserContextId&quot;=&gt;&quot;7895BFB24BF22CE40584808713D96E8D&quot;}}}
1634
- </span> <span class='id identifier rubyid_pending_target_info_changed_event'>pending_target_info_changed_event</span><span class='lbracket'>[</span><span class='id identifier rubyid_target_info'>target_info</span><span class='period'>.</span><span class='id identifier rubyid_target_id'>target_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_event'>event</span>
1635
- <span class='kw'>return</span>
1636
- <span class='comment'># original implementation is:
1637
- </span> <span class='comment'>#
1638
- </span> <span class='comment'># raise StandardError.new(&#39;target should exist before targetInfoChanged&#39;)
1639
- </span> <span class='kw'>end</span>
1640
- <span class='id identifier rubyid_previous_url'>previous_url</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
1641
- <span class='id identifier rubyid_was_initialized'>was_initialized</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized?'>initialized?</span>
1642
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_target_info_changed'>handle_target_info_changed</span><span class='lparen'>(</span><span class='id identifier rubyid_target_info'>target_info</span><span class='rparen'>)</span>
1643
- <span class='kw'>if</span> <span class='id identifier rubyid_was_initialized'>was_initialized</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_previous_url'>previous_url</span> <span class='op'>!=</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
1644
- <span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetChanged</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1645
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_browser_context'>browser_context</span><span class='period'>.</span><span class='id identifier rubyid_emit_event'>emit_event</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.BrowserContext.TargetChanged</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
1646
- <span class='kw'>end</span>
1647
- <span class='kw'>end</span></pre>
1648
- </td>
1649
- </tr>
1650
- </table>
1651
- </div>
1652
-
1653
- <div class="method_details ">
1654
- <h3 class="signature " id="new_page-instance_method">
1655
-
1656
- #<strong>new_page</strong> &#x21d2; <tt>Object</tt>
1657
-
1658
-
1659
-
1660
-
1661
-
1662
- </h3><table class="source_code">
1663
- <tr>
1664
- <td>
1665
- <pre class="lines">
1666
-
1667
-
1668
- 181
1669
- 182
1670
- 183</pre>
1671
- </td>
1672
- <td>
1673
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 181</span>
1674
-
1675
- <span class='kw'>def</span> <span class='id identifier rubyid_new_page'>new_page</span>
1676
- <span class='ivar'>@default_context</span><span class='period'>.</span><span class='id identifier rubyid_new_page'>new_page</span>
1677
- <span class='kw'>end</span></pre>
1678
- </td>
1679
- </tr>
1680
- </table>
1681
- </div>
1682
-
1683
- <div class="method_details ">
1684
- <h3 class="signature " id="on-instance_method">
1685
-
1686
- #<strong>on</strong>(event_name, &amp;block) &#x21d2; <tt>Object</tt>
1687
-
1688
-
1689
-
1690
-
1691
-
1692
- </h3><div class="docstring">
1693
- <div class="discussion">
1694
-
1695
-
1696
- </div>
1697
- </div>
1698
- <div class="tags">
1699
- <p class="tag_title">Parameters:</p>
1700
- <ul class="param">
1701
-
1702
- <li>
1703
-
1704
- <span class='name'>event_name</span>
1705
-
1706
-
1707
- <span class='type'>(<tt>Symbol</tt>)</span>
1708
-
1709
-
1710
-
1711
- &mdash;
1712
- <div class='inline'>
1713
- <p>either of :disconnected, :targetcreated, :targetchanged, :targetdestroyed</p>
1714
- </div>
1715
-
1716
- </li>
1717
-
1718
- </ul>
1719
-
1720
-
1721
- </div><table class="source_code">
1722
- <tr>
1723
- <td>
1724
- <pre class="lines">
1725
-
1726
-
1727
- 65
1728
- 66
1729
- 67
1730
- 68
1731
- 69
1732
- 70
1733
- 71</pre>
1734
- </td>
1735
- <td>
1736
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 65</span>
1737
-
1738
- <span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1739
- <span class='kw'>unless</span> <span class='const'><span class='object_link'><a href="#EVENT_MAPPINGS-constant" title="Puppeteer::Browser::EVENT_MAPPINGS (constant)">EVENT_MAPPINGS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span>
1740
- <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'>Unknown event name: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_name'>event_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>. Known events are </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#EVENT_MAPPINGS-constant" title="Puppeteer::Browser::EVENT_MAPPINGS (constant)">EVENT_MAPPINGS</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1741
- <span class='kw'>end</span>
1742
-
1743
- <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#EVENT_MAPPINGS-constant" title="Puppeteer::Browser::EVENT_MAPPINGS (constant)">EVENT_MAPPINGS</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_event_name'>event_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1744
- <span class='kw'>end</span></pre>
1745
- </td>
1746
- </tr>
1747
- </table>
1748
- </div>
1749
-
1750
- <div class="method_details ">
1751
- <h3 class="signature " id="pages-instance_method">
1752
-
1753
- #<strong>pages</strong> &#x21d2; <tt>!Promise&lt;!Array&lt;!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>&gt;&gt;</tt>
1754
-
1755
-
1756
-
1757
-
1758
-
1759
- </h3><div class="docstring">
1760
- <div class="discussion">
1761
-
1762
-
1763
- </div>
1764
- </div>
1765
- <div class="tags">
1766
-
1767
- <p class="tag_title">Returns:</p>
1768
- <ul class="return">
1769
-
1770
- <li>
1771
-
1772
-
1773
- <span class='type'>(<tt>!Promise&lt;!Array&lt;!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="Page.html" title="Puppeteer::Page (class)">Page</a></span>&gt;&gt;</tt>)</span>
1774
-
1775
-
1776
-
1777
- </li>
1778
-
1779
- </ul>
1780
-
1781
- </div><table class="source_code">
1782
- <tr>
1783
- <td>
1784
- <pre class="lines">
1785
-
1786
-
1787
- 250
1788
- 251
1789
- 252</pre>
1790
- </td>
1791
- <td>
1792
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 250</span>
1793
-
1794
- <span class='kw'>def</span> <span class='id identifier rubyid_pages'>pages</span>
1795
- <span class='id identifier rubyid_browser_contexts'>browser_contexts</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:pages</span><span class='rparen'>)</span>
1796
- <span class='kw'>end</span></pre>
1797
- </td>
1798
- </tr>
1799
- </table>
1800
- </div>
1801
-
1802
- <div class="method_details ">
1803
- <h3 class="signature " id="process-instance_method">
1804
-
1805
- #<strong>process</strong> &#x21d2; <tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span></tt>
1806
-
1807
-
1808
-
1809
-
1810
-
1811
- </h3><div class="docstring">
1812
- <div class="discussion">
1813
-
1814
-
1815
- </div>
1816
- </div>
1817
- <div class="tags">
1818
-
1819
- <p class="tag_title">Returns:</p>
1820
- <ul class="return">
1821
-
1822
- <li>
1823
-
1824
-
1825
- <span class='type'>(<tt><span class='object_link'><a href="BrowserRunner/BrowserProcess.html" title="Puppeteer::BrowserRunner::BrowserProcess (class)">Puppeteer::BrowserRunner::BrowserProcess</a></span></tt>)</span>
1826
-
1827
-
1828
-
1829
- </li>
1830
-
1831
- </ul>
1832
-
1833
- </div><table class="source_code">
1834
- <tr>
1835
- <td>
1836
- <pre class="lines">
1837
-
1838
-
1839
- 74
1840
- 75
1841
- 76</pre>
1842
- </td>
1843
- <td>
1844
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 74</span>
1845
-
1846
- <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span>
1847
- <span class='ivar'>@process</span>
1848
- <span class='kw'>end</span></pre>
1849
- </td>
1850
- </tr>
1851
- </table>
1852
- </div>
1853
-
1854
- <div class="method_details ">
1855
- <h3 class="signature " id="target-instance_method">
1856
-
1857
- #<strong>target</strong> &#x21d2; <tt>!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></tt>
1858
-
1859
-
1860
-
1861
-
1862
-
1863
- </h3><div class="docstring">
1864
- <div class="discussion">
1865
-
1866
-
1867
- </div>
1868
- </div>
1869
- <div class="tags">
1870
-
1871
- <p class="tag_title">Returns:</p>
1872
- <ul class="return">
1873
-
1874
- <li>
1875
-
1876
-
1877
- <span class='type'>(<tt>!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span></tt>)</span>
1878
-
1879
-
1880
-
1881
- </li>
1882
-
1883
- </ul>
1884
-
1885
- </div><table class="source_code">
1886
- <tr>
1887
- <td>
1888
- <pre class="lines">
1889
-
1890
-
1891
- 206
1892
- 207
1893
- 208</pre>
1894
- </td>
1895
- <td>
1896
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 206</span>
1897
-
1898
- <span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
1899
- <span class='id identifier rubyid_targets'>targets</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</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'>browser</span><span class='tstring_end'>&#39;</span></span> <span class='rbrace'>}</span>
1900
- <span class='kw'>end</span></pre>
1901
- </td>
1902
- </tr>
1903
- </table>
1904
- </div>
1905
-
1906
- <div class="method_details ">
1907
- <h3 class="signature " id="targets-instance_method">
1908
-
1909
- #<strong>targets</strong> &#x21d2; <tt>!Array&lt;!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>&gt;</tt>
1910
-
1911
-
1912
-
1913
-
1914
-
1915
- </h3><div class="docstring">
1916
- <div class="discussion">
1917
-
1918
-
1919
- </div>
1920
- </div>
1921
- <div class="tags">
1922
-
1923
- <p class="tag_title">Returns:</p>
1924
- <ul class="return">
1925
-
1926
- <li>
1927
-
1928
-
1929
- <span class='type'>(<tt>!Array&lt;!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>&gt;</tt>)</span>
1930
-
1931
-
1932
-
1933
- </li>
1934
-
1935
- </ul>
1936
-
1937
- </div><table class="source_code">
1938
- <tr>
1939
- <td>
1940
- <pre class="lines">
1941
-
1942
-
1943
- 200
1944
- 201
1945
- 202</pre>
1946
- </td>
1947
- <td>
1948
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 200</span>
1949
-
1950
- <span class='kw'>def</span> <span class='id identifier rubyid_targets'>targets</span>
1951
- <span class='ivar'>@targets</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_initialized?'>initialized?</span> <span class='rbrace'>}</span>
1952
- <span class='kw'>end</span></pre>
1953
- </td>
1954
- </tr>
1955
- </table>
1956
- </div>
1957
-
1958
- <div class="method_details ">
1959
- <h3 class="signature " id="user_agent-instance_method">
1960
-
1961
- #<strong>user_agent</strong> &#x21d2; <tt>String</tt>
1962
-
1963
-
1964
-
1965
-
1966
-
1967
- </h3><div class="docstring">
1968
- <div class="discussion">
1969
-
1970
-
1971
- </div>
1972
- </div>
1973
- <div class="tags">
1974
-
1975
- <p class="tag_title">Returns:</p>
1976
- <ul class="return">
1977
-
1978
- <li>
1979
-
1980
-
1981
- <span class='type'>(<tt>String</tt>)</span>
1982
-
1983
-
1984
-
1985
- </li>
1986
-
1987
- </ul>
1988
-
1989
- </div><table class="source_code">
1990
- <tr>
1991
- <td>
1992
- <pre class="lines">
1993
-
1994
-
1995
- 260
1996
- 261
1997
- 262</pre>
1998
- </td>
1999
- <td>
2000
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 260</span>
2001
-
2002
- <span class='kw'>def</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
2003
- <span class='id identifier rubyid_get_version'>get_version</span><span class='period'>.</span><span class='id identifier rubyid_user_agent'>user_agent</span>
2004
- <span class='kw'>end</span></pre>
2005
- </td>
2006
- </tr>
2007
- </table>
2008
- </div>
2009
-
2010
- <div class="method_details ">
2011
- <h3 class="signature " id="version-instance_method">
2012
-
2013
- #<strong>version</strong> &#x21d2; <tt>String</tt>
2014
-
2015
-
2016
-
2017
-
2018
-
2019
- </h3><div class="docstring">
2020
- <div class="discussion">
2021
-
2022
-
2023
- </div>
2024
- </div>
2025
- <div class="tags">
2026
-
2027
- <p class="tag_title">Returns:</p>
2028
- <ul class="return">
2029
-
2030
- <li>
2031
-
2032
-
2033
- <span class='type'>(<tt>String</tt>)</span>
2034
-
2035
-
2036
-
2037
- </li>
2038
-
2039
- </ul>
2040
-
2041
- </div><table class="source_code">
2042
- <tr>
2043
- <td>
2044
- <pre class="lines">
2045
-
2046
-
2047
- 255
2048
- 256
2049
- 257</pre>
2050
- </td>
2051
- <td>
2052
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 255</span>
2053
-
2054
- <span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
2055
- <span class='id identifier rubyid_get_version'>get_version</span><span class='period'>.</span><span class='id identifier rubyid_product'>product</span>
2056
- <span class='kw'>end</span></pre>
2057
- </td>
2058
- </tr>
2059
- </table>
2060
- </div>
2061
-
2062
- <div class="method_details ">
2063
- <h3 class="signature " id="wait_for_target-instance_method">
2064
-
2065
- #<strong>wait_for_target</strong>(predicate:, timeout: nil) &#x21d2; <tt>!Promise&lt;!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>&gt;</tt>
2066
-
2067
-
2068
-
2069
-
2070
-
2071
- </h3><div class="docstring">
2072
- <div class="discussion">
2073
-
2074
-
2075
- </div>
2076
- </div>
2077
- <div class="tags">
2078
- <p class="tag_title">Parameters:</p>
2079
- <ul class="param">
2080
-
2081
- <li>
2082
-
2083
- <span class='name'>predicate</span>
2084
-
2085
-
2086
- <span class='type'>(<tt>function(!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>):boolean</tt>)</span>
2087
-
2088
-
2089
-
2090
- </li>
2091
-
2092
- <li>
2093
-
2094
- <span class='name'>options</span>
2095
-
2096
-
2097
- <span class='type'>(<tt>{timeout?: number}=</tt>)</span>
2098
-
2099
-
2100
-
2101
- </li>
2102
-
2103
- </ul>
2104
-
2105
- <p class="tag_title">Returns:</p>
2106
- <ul class="return">
2107
-
2108
- <li>
2109
-
2110
-
2111
- <span class='type'>(<tt>!Promise&lt;!<span class='object_link'><a href="Target.html" title="Puppeteer::Target (class)">Target</a></span>&gt;</tt>)</span>
2112
-
2113
-
2114
-
2115
- </li>
2116
-
2117
- </ul>
2118
-
2119
- </div><table class="source_code">
2120
- <tr>
2121
- <td>
2122
- <pre class="lines">
2123
-
2124
-
2125
- 218
2126
- 219
2127
- 220
2128
- 221
2129
- 222
2130
- 223
2131
- 224
2132
- 225
2133
- 226
2134
- 227
2135
- 228
2136
- 229
2137
- 230
2138
- 231
2139
- 232
2140
- 233
2141
- 234
2142
- 235
2143
- 236
2144
- 237
2145
- 238
2146
- 239
2147
- 240
2148
- 241
2149
- 242
2150
- 243
2151
- 244
2152
- 245
2153
- 246
2154
- 247</pre>
2155
- </td>
2156
- <td>
2157
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 218</span>
2158
-
2159
- <span class='kw'>def</span> <span class='id identifier rubyid_wait_for_target'>wait_for_target</span><span class='lparen'>(</span><span class='label'>predicate:</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
2160
- <span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_timeout'>timeout</span> <span class='op'>||</span> <span class='int'>30000</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>/</span> <span class='float'>1000.0</span>
2161
- <span class='id identifier rubyid_existing_target'>existing_target</span> <span class='op'>=</span> <span class='id identifier rubyid_targets'>targets</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
2162
- <span class='kw'>return</span> <span class='id identifier rubyid_existing_target'>existing_target</span> <span class='kw'>if</span> <span class='id identifier rubyid_existing_target'>existing_target</span>
2163
-
2164
- <span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
2165
- <span class='id identifier rubyid_target_promise'>target_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>
2166
- <span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetCreated</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
2167
- <span class='kw'>if</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
2168
- <span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_fulfill'>fulfill</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
2169
- <span class='kw'>end</span>
2170
- <span class='kw'>end</span>
2171
- <span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_add_event_listener'>add_event_listener</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Events.Browser.TargetChanged</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_target'>target</span><span class='op'>|</span>
2172
- <span class='kw'>if</span> <span class='id identifier rubyid_predicate'>predicate</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
2173
- <span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_fulfill'>fulfill</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
2174
- <span class='kw'>end</span>
2175
- <span class='kw'>end</span>
2176
-
2177
- <span class='kw'>begin</span>
2178
- <span class='kw'>if</span> <span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span> <span class='op'>&gt;</span> <span class='int'>0</span>
2179
- <span class='const'>Timeout</span><span class='period'>.</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='id identifier rubyid_timeout_in_sec'>timeout_in_sec</span><span class='rparen'>)</span> <span class='kw'>do</span>
2180
- <span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
2181
- <span class='kw'>end</span>
2182
- <span class='kw'>else</span>
2183
- <span class='id identifier rubyid_target_promise'>target_promise</span><span class='period'>.</span><span class='id identifier rubyid_value!'>value!</span>
2184
- <span class='kw'>end</span>
2185
- <span class='kw'>ensure</span>
2186
- <span class='id identifier rubyid_remove_event_listener'>remove_event_listener</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_event_listening_ids'>event_listening_ids</span><span class='rparen'>)</span>
2187
- <span class='kw'>end</span>
2188
- <span class='kw'>end</span></pre>
2189
- </td>
2190
- </tr>
2191
- </table>
2192
- </div>
2193
-
2194
- <div class="method_details ">
2195
- <h3 class="signature " id="websocket_endpoint-instance_method">
2196
-
2197
- #<strong>websocket_endpoint</strong> &#x21d2; <tt>String</tt>
2198
-
2199
-
2200
-
2201
-
2202
-
2203
- </h3><div class="docstring">
2204
- <div class="discussion">
2205
-
2206
-
2207
- </div>
2208
- </div>
2209
- <div class="tags">
2210
-
2211
- <p class="tag_title">Returns:</p>
2212
- <ul class="return">
2213
-
2214
- <li>
2215
-
2216
-
2217
- <span class='type'>(<tt>String</tt>)</span>
2218
-
2219
-
2220
-
2221
- </li>
2222
-
2223
- </ul>
2224
-
2225
- </div><table class="source_code">
2226
- <tr>
2227
- <td>
2228
- <pre class="lines">
2229
-
2230
-
2231
- 177
2232
- 178
2233
- 179</pre>
2234
- </td>
2235
- <td>
2236
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 177</span>
2237
-
2238
- <span class='kw'>def</span> <span class='id identifier rubyid_websocket_endpoint'>websocket_endpoint</span>
2239
- <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
2240
- <span class='kw'>end</span></pre>
2241
- </td>
2242
- </tr>
2243
- </table>
2244
- </div>
2245
-
2246
- </div>
2247
-
2248
- </div>
2249
-
2250
- <div id="footer">
2251
- Generated on Wed Jun 24 03:08:00 2020 by
2252
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2253
- 0.9.24 (ruby-2.6.3).
2254
- </div>
2255
-
2256
- </div>
2257
- </body>
2258
- </html>