puppeteer-ruby 0.0.5 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/docs/Puppeteer.html +53 -43
  4. data/docs/Puppeteer/AsyncAwaitBehavior.html +1 -1
  5. data/docs/Puppeteer/Browser.html +255 -147
  6. data/docs/Puppeteer/BrowserContext.html +1 -1
  7. data/docs/Puppeteer/BrowserFetcher.html +1 -1
  8. data/docs/Puppeteer/BrowserRunner.html +1 -1
  9. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +1 -1
  10. data/docs/Puppeteer/CDPSession.html +86 -57
  11. data/docs/Puppeteer/CDPSession/Error.html +1 -1
  12. data/docs/Puppeteer/ConcurrentRubyUtils.html +1 -1
  13. data/docs/Puppeteer/Connection.html +65 -61
  14. data/docs/Puppeteer/Connection/MessageCallback.html +1 -1
  15. data/docs/Puppeteer/Connection/ProtocolError.html +1 -1
  16. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +5 -5
  17. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +12 -12
  18. data/docs/Puppeteer/ConsoleMessage.html +1 -1
  19. data/docs/Puppeteer/ConsoleMessage/Location.html +1 -1
  20. data/docs/Puppeteer/DOMWorld.html +708 -69
  21. data/docs/Puppeteer/DOMWorld/DetachedError.html +1 -1
  22. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +1 -1
  23. data/docs/Puppeteer/DebugPrint.html +2 -2
  24. data/docs/Puppeteer/Device.html +1 -1
  25. data/docs/Puppeteer/Devices.html +1 -1
  26. data/docs/Puppeteer/ElementHandle.html +1120 -181
  27. data/docs/Puppeteer/ElementHandle/BoundingBox.html +507 -0
  28. data/docs/Puppeteer/ElementHandle/BoxModel.html +404 -0
  29. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +5 -5
  30. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +5 -5
  31. data/docs/Puppeteer/ElementHandle/Point.html +40 -29
  32. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +1 -1
  33. data/docs/Puppeteer/EmulationManager.html +1 -1
  34. data/docs/Puppeteer/EventCallbackable.html +1 -1
  35. data/docs/Puppeteer/EventCallbackable/EventListeners.html +1 -1
  36. data/docs/Puppeteer/ExecutionContext.html +227 -1
  37. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +1 -1
  38. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +1 -1
  39. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +2 -2
  40. data/docs/Puppeteer/FileChooser.html +455 -0
  41. data/docs/Puppeteer/Frame.html +492 -304
  42. data/docs/Puppeteer/FrameManager.html +22 -26
  43. data/docs/Puppeteer/FrameManager/NavigationError.html +1 -1
  44. data/docs/Puppeteer/IfPresent.html +1 -1
  45. data/docs/Puppeteer/JSHandle.html +1 -1
  46. data/docs/Puppeteer/Keyboard.html +1 -1
  47. data/docs/Puppeteer/Keyboard/KeyDefinition.html +1 -1
  48. data/docs/Puppeteer/Keyboard/KeyDescription.html +1 -1
  49. data/docs/Puppeteer/Launcher.html +1 -1
  50. data/docs/Puppeteer/Launcher/Base.html +1 -1
  51. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +1 -1
  52. data/docs/Puppeteer/Launcher/BrowserOptions.html +1 -1
  53. data/docs/Puppeteer/Launcher/Chrome.html +64 -23
  54. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +1 -1
  55. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +1 -1
  56. data/docs/Puppeteer/Launcher/LaunchOptions.html +1 -1
  57. data/docs/Puppeteer/LifecycleWatcher.html +1 -1
  58. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +1 -1
  59. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +1 -1
  60. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +1 -1
  61. data/docs/Puppeteer/Mouse.html +31 -41
  62. data/docs/Puppeteer/Mouse/Button.html +1 -1
  63. data/docs/Puppeteer/NetworkManager.html +1 -1
  64. data/docs/Puppeteer/NetworkManager/Credentials.html +1 -1
  65. data/docs/Puppeteer/Page.html +980 -436
  66. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -0
  67. data/docs/Puppeteer/Page/ScreenshotOptions.html +1 -1
  68. data/docs/Puppeteer/Page/ScriptTag.html +24 -24
  69. data/docs/Puppeteer/Page/StyleTag.html +19 -19
  70. data/docs/Puppeteer/Page/TargetCrashedError.html +1 -1
  71. data/docs/Puppeteer/RemoteObject.html +173 -37
  72. data/docs/Puppeteer/Target.html +149 -197
  73. data/docs/Puppeteer/Target/InitializeFailure.html +1 -1
  74. data/docs/Puppeteer/Target/TargetInfo.html +1 -1
  75. data/docs/Puppeteer/TimeoutError.html +2 -2
  76. data/docs/Puppeteer/TimeoutSettings.html +1 -1
  77. data/docs/Puppeteer/TouchScreen.html +1 -1
  78. data/docs/Puppeteer/Viewport.html +81 -1
  79. data/docs/Puppeteer/WaitTask.html +434 -8
  80. data/docs/Puppeteer/WaitTask/TerminatedError.html +1 -1
  81. data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -0
  82. data/docs/Puppeteer/WebSocket.html +26 -26
  83. data/docs/Puppeteer/WebSocket/DriverImpl.html +1 -1
  84. data/docs/Puppeteer/WebSocket/TransportError.html +124 -0
  85. data/docs/Puppeteer/WebSocketTransport.html +2 -2
  86. data/docs/Puppeteer/WebSocktTransportError.html +1 -1
  87. data/docs/_index.html +47 -19
  88. data/docs/class_list.html +1 -1
  89. data/docs/file.README.html +5 -3
  90. data/docs/index.html +5 -3
  91. data/docs/method_list.html +788 -444
  92. data/docs/top-level-namespace.html +1 -1
  93. data/lib/puppeteer.rb +7 -1
  94. data/lib/puppeteer/browser.rb +21 -6
  95. data/lib/puppeteer/browser_runner.rb +1 -1
  96. data/lib/puppeteer/cdp_session.rb +33 -11
  97. data/lib/puppeteer/connection.rb +13 -1
  98. data/lib/puppeteer/dom_world.rb +113 -108
  99. data/lib/puppeteer/element_handle.rb +183 -222
  100. data/lib/puppeteer/element_handle/bounding_box.rb +12 -0
  101. data/lib/puppeteer/element_handle/box_model.rb +19 -0
  102. data/lib/puppeteer/element_handle/point.rb +26 -0
  103. data/lib/puppeteer/errors.rb +1 -3
  104. data/lib/puppeteer/execution_context.rb +36 -17
  105. data/lib/puppeteer/file_chooser.rb +29 -0
  106. data/lib/puppeteer/frame.rb +32 -12
  107. data/lib/puppeteer/frame_manager.rb +0 -2
  108. data/lib/puppeteer/launcher/chrome.rb +48 -2
  109. data/lib/puppeteer/mouse.rb +3 -8
  110. data/lib/puppeteer/page.rb +116 -65
  111. data/lib/puppeteer/remote_object.rb +15 -1
  112. data/lib/puppeteer/target.rb +24 -24
  113. data/lib/puppeteer/version.rb +1 -1
  114. data/lib/puppeteer/viewport.rb +18 -0
  115. data/lib/puppeteer/wait_task.rb +183 -1
  116. data/lib/puppeteer/web_socket.rb +3 -1
  117. data/lib/puppeteer/web_socket_transport.rb +1 -1
  118. metadata +12 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 004c8ed7d2156f9c7dc0bc94cd55d256f75a3c202c5a4f08d0ecb521197a2610
4
- data.tar.gz: 4027e08fee57a18800d671db905e2b9a4bf22d15e3a3bde80c68906c278e04f2
3
+ metadata.gz: a07fd2c57e3c62d4707af33800a1b8c4470324c1b42e4a30646799d773008919
4
+ data.tar.gz: ebef1b4801f825d61227e802009dc0ba265f9a934713aee77378da04e8b00788
5
5
  SHA512:
6
- metadata.gz: fde9b594b77f123b290edfe3ccbffe6f807485cb1042f5bde48a731e1d9b5eda9b9b34a17d1fe47b751e758855dffb180a06833fc57792a427fc9925ffdd04c0
7
- data.tar.gz: 70134f98e0e1ed19bc5c57186575d40b2c53099d4856031010c3f69dfa0498ee854464639604f5c6ba5a300523bb322e1f92ac267cb32c8fa253f2fecdcd367a
6
+ metadata.gz: d953d0f11e1c764bbd046d8124306231f3f735a7cf39566d15c357694d96f8305319eddd914e6e53232fc860d1b64b7e4389700311e917f1117de310a2c76a99
7
+ data.tar.gz: 8f87363c9b82ff27c8747423c74d25f98a19a9b288a77fbb46cd5336a65ad2555d13d58778734a1a4c47589e0c956da4385879e988b29b444a90261f3b6fb94e
data/README.md CHANGED
@@ -43,10 +43,11 @@ Puppeteer.launch(headless: false, slow_mo: 50, args: ['--guest', '--window-size=
43
43
  end
44
44
  ```
45
45
 
46
- ![puppeteer-ruby](https://user-images.githubusercontent.com/11763113/78505735-6e7f3000-77b0-11ea-9c82-9016828dd2a9.gif)
46
+ More usage examples can be found [here](https://github.com/YusukeIwaki/puppeteer-ruby-example)
47
47
 
48
+ ## API
48
49
 
49
- More usage examples can be found [here](https://github.com/YusukeIwaki/puppeteer-ruby-example)
50
+ https://yusukeiwaki.github.io/puppeteer-ruby/
50
51
 
51
52
  ## Contributing
52
53
 
@@ -120,7 +120,7 @@
120
120
 
121
121
 
122
122
 
123
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Puppeteer/Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>, <span class='object_link'><a href="Puppeteer/BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span>, <span class='object_link'><a href="Puppeteer/BrowserFetcher.html" title="Puppeteer::BrowserFetcher (class)">BrowserFetcher</a></span>, <span class='object_link'><a href="Puppeteer/BrowserRunner.html" title="Puppeteer::BrowserRunner (class)">BrowserRunner</a></span>, <span class='object_link'><a href="Puppeteer/CDPSession.html" title="Puppeteer::CDPSession (class)">CDPSession</a></span>, <span class='object_link'><a href="Puppeteer/Connection.html" title="Puppeteer::Connection (class)">Connection</a></span>, <span class='object_link'><a href="Puppeteer/ConsoleMessage.html" title="Puppeteer::ConsoleMessage (class)">ConsoleMessage</a></span>, <span class='object_link'><a href="Puppeteer/DOMWorld.html" title="Puppeteer::DOMWorld (class)">DOMWorld</a></span>, <span class='object_link'><a href="Puppeteer/Device.html" title="Puppeteer::Device (class)">Device</a></span>, <span class='object_link'><a href="Puppeteer/Devices.html" title="Puppeteer::Devices (class)">Devices</a></span>, <span class='object_link'><a href="Puppeteer/ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span>, <span class='object_link'><a href="Puppeteer/EmulationManager.html" title="Puppeteer::EmulationManager (class)">EmulationManager</a></span>, <span class='object_link'><a href="Puppeteer/ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">ExecutionContext</a></span>, <span class='object_link'><a href="Puppeteer/Frame.html" title="Puppeteer::Frame (class)">Frame</a></span>, <span class='object_link'><a href="Puppeteer/FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span>, <span class='object_link'><a href="Puppeteer/JSHandle.html" title="Puppeteer::JSHandle (class)">JSHandle</a></span>, <span class='object_link'><a href="Puppeteer/Keyboard.html" title="Puppeteer::Keyboard (class)">Keyboard</a></span>, <span class='object_link'><a href="Puppeteer/LifecycleWatcher.html" title="Puppeteer::LifecycleWatcher (class)">LifecycleWatcher</a></span>, <span class='object_link'><a href="Puppeteer/Mouse.html" title="Puppeteer::Mouse (class)">Mouse</a></span>, <span class='object_link'><a href="Puppeteer/NetworkManager.html" title="Puppeteer::NetworkManager (class)">NetworkManager</a></span>, <span class='object_link'><a href="Puppeteer/Page.html" title="Puppeteer::Page (class)">Page</a></span>, <span class='object_link'><a href="Puppeteer/RemoteObject.html" title="Puppeteer::RemoteObject (class)">RemoteObject</a></span>, <span class='object_link'><a href="Puppeteer/Target.html" title="Puppeteer::Target (class)">Target</a></span>, <span class='object_link'><a href="Puppeteer/TimeoutError.html" title="Puppeteer::TimeoutError (class)">TimeoutError</a></span>, <span class='object_link'><a href="Puppeteer/TimeoutSettings.html" title="Puppeteer::TimeoutSettings (class)">TimeoutSettings</a></span>, <span class='object_link'><a href="Puppeteer/TouchScreen.html" title="Puppeteer::TouchScreen (class)">TouchScreen</a></span>, <span class='object_link'><a href="Puppeteer/Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span>, <span class='object_link'><a href="Puppeteer/WaitTask.html" title="Puppeteer::WaitTask (class)">WaitTask</a></span>, <span class='object_link'><a href="Puppeteer/WebSocket.html" title="Puppeteer::WebSocket (class)">WebSocket</a></span>, <span class='object_link'><a href="Puppeteer/WebSocketTransport.html" title="Puppeteer::WebSocketTransport (class)">WebSocketTransport</a></span>, <span class='object_link'><a href="Puppeteer/WebSocktTransportError.html" title="Puppeteer::WebSocktTransportError (class)">WebSocktTransportError</a></span>
123
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Puppeteer/Browser.html" title="Puppeteer::Browser (class)">Browser</a></span>, <span class='object_link'><a href="Puppeteer/BrowserContext.html" title="Puppeteer::BrowserContext (class)">BrowserContext</a></span>, <span class='object_link'><a href="Puppeteer/BrowserFetcher.html" title="Puppeteer::BrowserFetcher (class)">BrowserFetcher</a></span>, <span class='object_link'><a href="Puppeteer/BrowserRunner.html" title="Puppeteer::BrowserRunner (class)">BrowserRunner</a></span>, <span class='object_link'><a href="Puppeteer/CDPSession.html" title="Puppeteer::CDPSession (class)">CDPSession</a></span>, <span class='object_link'><a href="Puppeteer/Connection.html" title="Puppeteer::Connection (class)">Connection</a></span>, <span class='object_link'><a href="Puppeteer/ConsoleMessage.html" title="Puppeteer::ConsoleMessage (class)">ConsoleMessage</a></span>, <span class='object_link'><a href="Puppeteer/DOMWorld.html" title="Puppeteer::DOMWorld (class)">DOMWorld</a></span>, <span class='object_link'><a href="Puppeteer/Device.html" title="Puppeteer::Device (class)">Device</a></span>, <span class='object_link'><a href="Puppeteer/Devices.html" title="Puppeteer::Devices (class)">Devices</a></span>, <span class='object_link'><a href="Puppeteer/ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span>, <span class='object_link'><a href="Puppeteer/EmulationManager.html" title="Puppeteer::EmulationManager (class)">EmulationManager</a></span>, <span class='object_link'><a href="Puppeteer/ExecutionContext.html" title="Puppeteer::ExecutionContext (class)">ExecutionContext</a></span>, <span class='object_link'><a href="Puppeteer/FileChooser.html" title="Puppeteer::FileChooser (class)">FileChooser</a></span>, <span class='object_link'><a href="Puppeteer/Frame.html" title="Puppeteer::Frame (class)">Frame</a></span>, <span class='object_link'><a href="Puppeteer/FrameManager.html" title="Puppeteer::FrameManager (class)">FrameManager</a></span>, <span class='object_link'><a href="Puppeteer/JSHandle.html" title="Puppeteer::JSHandle (class)">JSHandle</a></span>, <span class='object_link'><a href="Puppeteer/Keyboard.html" title="Puppeteer::Keyboard (class)">Keyboard</a></span>, <span class='object_link'><a href="Puppeteer/LifecycleWatcher.html" title="Puppeteer::LifecycleWatcher (class)">LifecycleWatcher</a></span>, <span class='object_link'><a href="Puppeteer/Mouse.html" title="Puppeteer::Mouse (class)">Mouse</a></span>, <span class='object_link'><a href="Puppeteer/NetworkManager.html" title="Puppeteer::NetworkManager (class)">NetworkManager</a></span>, <span class='object_link'><a href="Puppeteer/Page.html" title="Puppeteer::Page (class)">Page</a></span>, <span class='object_link'><a href="Puppeteer/RemoteObject.html" title="Puppeteer::RemoteObject (class)">RemoteObject</a></span>, <span class='object_link'><a href="Puppeteer/Target.html" title="Puppeteer::Target (class)">Target</a></span>, <span class='object_link'><a href="Puppeteer/TimeoutError.html" title="Puppeteer::TimeoutError (class)">TimeoutError</a></span>, <span class='object_link'><a href="Puppeteer/TimeoutSettings.html" title="Puppeteer::TimeoutSettings (class)">TimeoutSettings</a></span>, <span class='object_link'><a href="Puppeteer/TouchScreen.html" title="Puppeteer::TouchScreen (class)">TouchScreen</a></span>, <span class='object_link'><a href="Puppeteer/Viewport.html" title="Puppeteer::Viewport (class)">Viewport</a></span>, <span class='object_link'><a href="Puppeteer/WaitTask.html" title="Puppeteer::WaitTask (class)">WaitTask</a></span>, <span class='object_link'><a href="Puppeteer/WebSocket.html" title="Puppeteer::WebSocket (class)">WebSocket</a></span>, <span class='object_link'><a href="Puppeteer/WebSocketTransport.html" title="Puppeteer::WebSocketTransport (class)">WebSocketTransport</a></span>
124
124
 
125
125
 
126
126
  </p>
@@ -1012,7 +1012,7 @@
1012
1012
  <dt id="VERSION-constant" class="">VERSION =
1013
1013
 
1014
1014
  </dt>
1015
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.0.4</span><span class='tstring_end'>&#39;</span></span></pre></dd>
1015
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.0.11</span><span class='tstring_end'>&#39;</span></span></pre></dd>
1016
1016
 
1017
1017
  </dl>
1018
1018
 
@@ -1333,14 +1333,14 @@
1333
1333
  <pre class="lines">
1334
1334
 
1335
1335
 
1336
- 68
1337
1336
  69
1338
1337
  70
1339
1338
  71
1340
- 72</pre>
1339
+ 72
1340
+ 73</pre>
1341
1341
  </td>
1342
1342
  <td>
1343
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 68</span>
1343
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 69</span>
1344
1344
 
1345
1345
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>project_root:</span><span class='comma'>,</span> <span class='label'>preferred_revision:</span><span class='comma'>,</span> <span class='label'>is_puppeteer_core:</span><span class='rparen'>)</span>
1346
1346
  <span class='ivar'>@project_root</span> <span class='op'>=</span> <span class='id identifier rubyid_project_root'>project_root</span>
@@ -1374,16 +1374,16 @@
1374
1374
  <pre class="lines">
1375
1375
 
1376
1376
 
1377
- 56
1378
1377
  57
1379
1378
  58
1380
1379
  59
1381
1380
  60
1382
1381
  61
1383
- 62</pre>
1382
+ 62
1383
+ 63</pre>
1384
1384
  </td>
1385
1385
  <td>
1386
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 56</span>
1386
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 57</span>
1387
1387
 
1388
1388
  <span class='kw'>def</span> <span class='id identifier rubyid_instance'>instance</span>
1389
1389
  <span class='ivar'>@instance</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="" title="Puppeteer (class)">Puppeteer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Puppeteer#initialize (method)">new</a></span></span><span class='lparen'>(</span>
@@ -1412,12 +1412,12 @@
1412
1412
  <pre class="lines">
1413
1413
 
1414
1414
 
1415
- 52
1416
1415
  53
1417
- 54</pre>
1416
+ 54
1417
+ 55</pre>
1418
1418
  </td>
1419
1419
  <td>
1420
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 52</span>
1420
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 53</span>
1421
1421
 
1422
1422
  <span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1423
1423
  <span class='id identifier rubyid_instance'>instance</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
@@ -1485,7 +1485,6 @@
1485
1485
  <pre class="lines">
1486
1486
 
1487
1487
 
1488
- 129
1489
1488
  130
1490
1489
  131
1491
1490
  132
@@ -1502,10 +1501,16 @@
1502
1501
  143
1503
1502
  144
1504
1503
  145
1505
- 146</pre>
1504
+ 146
1505
+ 147
1506
+ 148
1507
+ 149
1508
+ 150
1509
+ 151
1510
+ 152</pre>
1506
1511
  </td>
1507
1512
  <td>
1508
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 129</span>
1513
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 130</span>
1509
1514
 
1510
1515
  <span class='kw'>def</span> <span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span>
1511
1516
  <span class='label'>browser_ws_endpoint:</span> <span class='kw'>nil</span><span class='comma'>,</span>
@@ -1523,7 +1528,12 @@
1523
1528
  <span class='label'>default_viewport:</span> <span class='id identifier rubyid_default_viewport'>default_viewport</span><span class='comma'>,</span>
1524
1529
  <span class='label'>slow_mo:</span> <span class='id identifier rubyid_slow_mo'>slow_mo</span><span class='comma'>,</span>
1525
1530
  <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
1526
- <span class='id identifier rubyid_launcher'>launcher</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
1531
+ <span class='id identifier rubyid_browser'>browser</span> <span class='op'>=</span> <span class='id identifier rubyid_launcher'>launcher</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
1532
+ <span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
1533
+ <span class='kw'>yield</span><span class='lparen'>(</span><span class='id identifier rubyid_browser'>browser</span><span class='rparen'>)</span>
1534
+ <span class='kw'>else</span>
1535
+ <span class='id identifier rubyid_browser'>browser</span>
1536
+ <span class='kw'>end</span>
1527
1537
  <span class='kw'>end</span></pre>
1528
1538
  </td>
1529
1539
  </tr>
@@ -1584,12 +1594,12 @@
1584
1594
  <pre class="lines">
1585
1595
 
1586
1596
 
1587
- 191
1588
- 192
1589
- 193</pre>
1597
+ 197
1598
+ 198
1599
+ 199</pre>
1590
1600
  </td>
1591
1601
  <td>
1592
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 191</span>
1602
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 197</span>
1593
1603
 
1594
1604
  <span class='kw'>def</span> <span class='id identifier rubyid_createBrowserFetcher'>createBrowserFetcher</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1595
1605
  <span class='const'><span class='object_link'><a href="Puppeteer/BrowserFetcher.html" title="Puppeteer::BrowserFetcher (class)">BrowserFetcher</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Puppeteer/BrowserFetcher.html#initialize-instance_method" title="Puppeteer::BrowserFetcher#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@project_root</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
@@ -1651,18 +1661,18 @@
1651
1661
  <pre class="lines">
1652
1662
 
1653
1663
 
1654
- 179
1655
- 180
1656
- 181
1657
- 182
1658
- 183
1659
- 184
1660
1664
  185
1661
1665
  186
1662
- 187</pre>
1666
+ 187
1667
+ 188
1668
+ 189
1669
+ 190
1670
+ 191
1671
+ 192
1672
+ 193</pre>
1663
1673
  </td>
1664
1674
  <td>
1665
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 179</span>
1675
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 185</span>
1666
1676
 
1667
1677
  <span class='kw'>def</span> <span class='id identifier rubyid_default_args'>default_args</span><span class='lparen'>(</span><span class='label'>args:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>user_data_dir:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>devtools:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>headless:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1668
1678
  <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
@@ -1715,12 +1725,12 @@
1715
1725
  <pre class="lines">
1716
1726
 
1717
1727
 
1718
- 168
1719
- 169
1720
- 170</pre>
1728
+ 174
1729
+ 175
1730
+ 176</pre>
1721
1731
  </td>
1722
1732
  <td>
1723
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 168</span>
1733
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 174</span>
1724
1734
 
1725
1735
  <span class='kw'>def</span> <span class='id identifier rubyid_devices'>devices</span>
1726
1736
  <span class='const'><span class='object_link'><a href="" title="Puppeteer (class)">Puppeteer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Puppeteer/Devices.html" title="Puppeteer::Devices (class)">Devices</a></span></span>
@@ -1767,12 +1777,12 @@
1767
1777
  <pre class="lines">
1768
1778
 
1769
1779
 
1770
- 149
1771
- 150
1772
- 151</pre>
1780
+ 155
1781
+ 156
1782
+ 157</pre>
1773
1783
  </td>
1774
1784
  <td>
1775
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 149</span>
1785
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 155</span>
1776
1786
 
1777
1787
  <span class='kw'>def</span> <span class='id identifier rubyid_executable_path'>executable_path</span>
1778
1788
  <span class='id identifier rubyid_launcher'>launcher</span><span class='period'>.</span><span class='id identifier rubyid_executable_path'>executable_path</span>
@@ -1834,7 +1844,6 @@
1834
1844
  <pre class="lines">
1835
1845
 
1836
1846
 
1837
- 76
1838
1847
  77
1839
1848
  78
1840
1849
  79
@@ -1883,10 +1892,11 @@
1883
1892
  122
1884
1893
  123
1885
1894
  124
1886
- 125</pre>
1895
+ 125
1896
+ 126</pre>
1887
1897
  </td>
1888
1898
  <td>
1889
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 76</span>
1899
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 77</span>
1890
1900
 
1891
1901
  <span class='kw'>def</span> <span class='id identifier rubyid_launch'>launch</span><span class='lparen'>(</span>
1892
1902
  <span class='label'>product:</span> <span class='kw'>nil</span><span class='comma'>,</span>
@@ -1980,12 +1990,12 @@
1980
1990
  <pre class="lines">
1981
1991
 
1982
1992
 
1983
- 163
1984
- 164
1985
- 165</pre>
1993
+ 169
1994
+ 170
1995
+ 171</pre>
1986
1996
  </td>
1987
1997
  <td>
1988
- <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 163</span>
1998
+ <pre class="code"><span class="info file"># File 'lib/puppeteer.rb', line 169</span>
1989
1999
 
1990
2000
  <span class='kw'>def</span> <span class='id identifier rubyid_product'>product</span>
1991
2001
  <span class='id identifier rubyid_launcher'>launcher</span><span class='period'>.</span><span class='id identifier rubyid_product'>product</span>
@@ -2000,7 +2010,7 @@
2000
2010
  </div>
2001
2011
 
2002
2012
  <div id="footer">
2003
- Generated on Sun Apr 26 15:52:55 2020 by
2013
+ Generated on Sat Jun 20 17:15:06 2020 by
2004
2014
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2005
2015
  0.9.24 (ruby-2.6.3).
2006
2016
  </div>
@@ -95,7 +95,7 @@
95
95
  </div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Sun Apr 26 15:52:55 2020 by
98
+ Generated on Sat Jun 20 17:15:05 2020 by
99
99
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
100
  0.9.24 (ruby-2.6.3).
101
101
  </div>
@@ -105,6 +105,27 @@
105
105
  </div>
106
106
 
107
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
+
108
129
 
109
130
 
110
131
 
@@ -435,6 +456,28 @@
435
456
 
436
457
 
437
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
+
438
481
  <span class="summary_desc"><div class='inline'></div></span>
439
482
 
440
483
  </li>
@@ -790,7 +833,7 @@
790
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>
791
834
  <span class='kw'>end</span>
792
835
  <span class='ivar'>@targets</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
793
- <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.CDPSession.Disconnected</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>do</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>
794
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>
795
838
  <span class='kw'>end</span>
796
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>
@@ -957,12 +1000,12 @@
957
1000
  <pre class="lines">
958
1001
 
959
1002
 
960
- 69
961
- 70
962
- 71</pre>
1003
+ 85
1004
+ 86
1005
+ 87</pre>
963
1006
  </td>
964
1007
  <td>
965
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 69</span>
1008
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 85</span>
966
1009
 
967
1010
  <span class='kw'>def</span> <span class='id identifier rubyid_browser_contexts'>browser_contexts</span>
968
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>
@@ -987,13 +1030,13 @@
987
1030
  <pre class="lines">
988
1031
 
989
1032
 
990
- 244
991
- 245
992
- 246
993
- 247</pre>
1033
+ 259
1034
+ 260
1035
+ 261
1036
+ 262</pre>
994
1037
  </td>
995
1038
  <td>
996
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 244</span>
1039
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 259</span>
997
1040
 
998
1041
  <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
999
1042
  <span class='ivar'>@close_callback</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
@@ -1041,12 +1084,12 @@
1041
1084
  <pre class="lines">
1042
1085
 
1043
1086
 
1044
- 253
1045
- 254
1046
- 255</pre>
1087
+ 268
1088
+ 269
1089
+ 270</pre>
1047
1090
  </td>
1048
1091
  <td>
1049
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 253</span>
1092
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 268</span>
1050
1093
 
1051
1094
  <span class='kw'>def</span> <span class='id identifier rubyid_connected?'>connected?</span>
1052
1095
  <span class='op'>!</span><span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_closed?'>closed?</span>
@@ -1093,14 +1136,14 @@
1093
1136
  <pre class="lines">
1094
1137
 
1095
1138
 
1096
- 63
1097
- 64
1098
- 65
1099
- 66
1100
- 67</pre>
1139
+ 79
1140
+ 80
1141
+ 81
1142
+ 82
1143
+ 83</pre>
1101
1144
  </td>
1102
1145
  <td>
1103
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 63</span>
1146
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 79</span>
1104
1147
 
1105
1148
  <span class='kw'>def</span> <span class='id identifier rubyid_create_incognito_browser_context'>create_incognito_browser_context</span>
1106
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>
@@ -1164,20 +1207,20 @@
1164
1207
  <pre class="lines">
1165
1208
 
1166
1209
 
1167
- 172
1168
- 173
1169
- 174
1170
- 175
1171
- 176
1172
- 177
1173
- 178
1174
- 179
1175
- 180
1176
- 181
1177
- 182</pre>
1210
+ 187
1211
+ 188
1212
+ 189
1213
+ 190
1214
+ 191
1215
+ 192
1216
+ 193
1217
+ 194
1218
+ 195
1219
+ 196
1220
+ 197</pre>
1178
1221
  </td>
1179
1222
  <td>
1180
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 172</span>
1223
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 187</span>
1181
1224
 
1182
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>
1183
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>
@@ -1232,12 +1275,12 @@
1232
1275
  <pre class="lines">
1233
1276
 
1234
1277
 
1235
- 74
1236
- 75
1237
- 76</pre>
1278
+ 90
1279
+ 91
1280
+ 92</pre>
1238
1281
  </td>
1239
1282
  <td>
1240
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 74</span>
1283
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 90</span>
1241
1284
 
1242
1285
  <span class='kw'>def</span> <span class='id identifier rubyid_default_browser_context'>default_browser_context</span>
1243
1286
  <span class='ivar'>@default_context</span>
@@ -1262,12 +1305,12 @@
1262
1305
  <pre class="lines">
1263
1306
 
1264
1307
 
1265
- 249
1266
- 250
1267
- 251</pre>
1308
+ 264
1309
+ 265
1310
+ 266</pre>
1268
1311
  </td>
1269
1312
  <td>
1270
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 249</span>
1313
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 264</span>
1271
1314
 
1272
1315
  <span class='kw'>def</span> <span class='id identifier rubyid_disconnect'>disconnect</span>
1273
1316
  <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_dispose'>dispose</span>
@@ -1316,13 +1359,13 @@
1316
1359
  <pre class="lines">
1317
1360
 
1318
1361
 
1319
- 79
1320
- 80
1321
- 81
1322
- 82</pre>
1362
+ 95
1363
+ 96
1364
+ 97
1365
+ 98</pre>
1323
1366
  </td>
1324
1367
  <td>
1325
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 79</span>
1368
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 95</span>
1326
1369
 
1327
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>
1328
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,22 +1415,6 @@
1372
1415
  <pre class="lines">
1373
1416
 
1374
1417
 
1375
- 85
1376
- 86
1377
- 87
1378
- 88
1379
- 89
1380
- 90
1381
- 91
1382
- 92
1383
- 93
1384
- 94
1385
- 95
1386
- 96
1387
- 97
1388
- 98
1389
- 99
1390
- 100
1391
1418
  101
1392
1419
  102
1393
1420
  103
@@ -1401,10 +1428,25 @@
1401
1428
  111
1402
1429
  112
1403
1430
  113
1404
- 114</pre>
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>
1405
1447
  </td>
1406
1448
  <td>
1407
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 85</span>
1449
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 101</span>
1408
1450
 
1409
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>
1410
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>
@@ -1426,8 +1468,7 @@
1426
1468
  <span class='rparen'>)</span>
1427
1469
  <span class='comment'># assert(!this._targets.has(event.targetInfo.targetId), &#39;Target should not exist before targetCreated&#39;);
1428
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>
1429
-
1430
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_on_initialize_succeeded'>on_initialize_succeeded</span> <span class='kw'>do</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>
1431
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>
1432
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>
1433
1474
  <span class='kw'>end</span>
@@ -1480,28 +1521,28 @@
1480
1521
  <pre class="lines">
1481
1522
 
1482
1523
 
1483
- 118
1484
- 119
1485
- 120
1486
- 121
1487
- 122
1488
- 123
1489
- 124
1490
- 125
1491
- 126
1492
- 127
1493
- 128</pre>
1524
+ 133
1525
+ 134
1526
+ 135
1527
+ 136
1528
+ 137
1529
+ 138
1530
+ 139
1531
+ 140
1532
+ 141
1533
+ 142
1534
+ 143</pre>
1494
1535
  </td>
1495
1536
  <td>
1496
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 118</span>
1537
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 133</span>
1497
1538
 
1498
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>
1499
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>
1500
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>
1501
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_initialized'>handle_initialized</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</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>
1502
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>
1503
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_handle_closed'>handle_closed</span>
1504
- <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_on_initialize_succeeded'>on_initialize_succeeded</span> <span class='kw'>do</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>
1505
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>
1506
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>
1507
1548
  <span class='kw'>end</span>
@@ -1550,21 +1591,6 @@
1550
1591
  <pre class="lines">
1551
1592
 
1552
1593
 
1553
- 131
1554
- 132
1555
- 133
1556
- 134
1557
- 135
1558
- 136
1559
- 137
1560
- 138
1561
- 139
1562
- 140
1563
- 141
1564
- 142
1565
- 143
1566
- 144
1567
- 145
1568
1594
  146
1569
1595
  147
1570
1596
  148
@@ -1574,10 +1600,25 @@
1574
1600
  152
1575
1601
  153
1576
1602
  154
1577
- 155</pre>
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>
1578
1619
  </td>
1579
1620
  <td>
1580
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 131</span>
1621
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 146</span>
1581
1622
 
1582
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>
1583
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>
@@ -1624,12 +1665,12 @@
1624
1665
  <pre class="lines">
1625
1666
 
1626
1667
 
1627
- 166
1628
- 167
1629
- 168</pre>
1668
+ 181
1669
+ 182
1670
+ 183</pre>
1630
1671
  </td>
1631
1672
  <td>
1632
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 166</span>
1673
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 181</span>
1633
1674
 
1634
1675
  <span class='kw'>def</span> <span class='id identifier rubyid_new_page'>new_page</span>
1635
1676
  <span class='ivar'>@default_context</span><span class='period'>.</span><span class='id identifier rubyid_new_page'>new_page</span>
@@ -1637,6 +1678,73 @@
1637
1678
  </td>
1638
1679
  </tr>
1639
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>
1640
1748
  </div>
1641
1749
 
1642
1750
  <div class="method_details ">
@@ -1676,12 +1784,12 @@
1676
1784
  <pre class="lines">
1677
1785
 
1678
1786
 
1679
- 230
1680
- 231
1681
- 232</pre>
1787
+ 245
1788
+ 246
1789
+ 247</pre>
1682
1790
  </td>
1683
1791
  <td>
1684
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 230</span>
1792
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 245</span>
1685
1793
 
1686
1794
  <span class='kw'>def</span> <span class='id identifier rubyid_pages'>pages</span>
1687
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>
@@ -1728,12 +1836,12 @@
1728
1836
  <pre class="lines">
1729
1837
 
1730
1838
 
1731
- 58
1732
- 59
1733
- 60</pre>
1839
+ 74
1840
+ 75
1841
+ 76</pre>
1734
1842
  </td>
1735
1843
  <td>
1736
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 58</span>
1844
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 74</span>
1737
1845
 
1738
1846
  <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span>
1739
1847
  <span class='ivar'>@process</span>
@@ -1780,12 +1888,12 @@
1780
1888
  <pre class="lines">
1781
1889
 
1782
1890
 
1783
- 191
1784
- 192
1785
- 193</pre>
1891
+ 206
1892
+ 207
1893
+ 208</pre>
1786
1894
  </td>
1787
1895
  <td>
1788
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 191</span>
1896
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 206</span>
1789
1897
 
1790
1898
  <span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
1791
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>
@@ -1832,12 +1940,12 @@
1832
1940
  <pre class="lines">
1833
1941
 
1834
1942
 
1835
- 185
1836
- 186
1837
- 187</pre>
1943
+ 200
1944
+ 201
1945
+ 202</pre>
1838
1946
  </td>
1839
1947
  <td>
1840
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 185</span>
1948
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 200</span>
1841
1949
 
1842
1950
  <span class='kw'>def</span> <span class='id identifier rubyid_targets'>targets</span>
1843
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>
@@ -1884,12 +1992,12 @@
1884
1992
  <pre class="lines">
1885
1993
 
1886
1994
 
1887
- 240
1888
- 241
1889
- 242</pre>
1995
+ 255
1996
+ 256
1997
+ 257</pre>
1890
1998
  </td>
1891
1999
  <td>
1892
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 240</span>
2000
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 255</span>
1893
2001
 
1894
2002
  <span class='kw'>def</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
1895
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>
@@ -1936,12 +2044,12 @@
1936
2044
  <pre class="lines">
1937
2045
 
1938
2046
 
1939
- 235
1940
- 236
1941
- 237</pre>
2047
+ 250
2048
+ 251
2049
+ 252</pre>
1942
2050
  </td>
1943
2051
  <td>
1944
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 235</span>
2052
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 250</span>
1945
2053
 
1946
2054
  <span class='kw'>def</span> <span class='id identifier rubyid_version'>version</span>
1947
2055
  <span class='id identifier rubyid_get_version'>get_version</span><span class='period'>.</span><span class='id identifier rubyid_product'>product</span>
@@ -2014,21 +2122,6 @@
2014
2122
  <pre class="lines">
2015
2123
 
2016
2124
 
2017
- 198
2018
- 199
2019
- 200
2020
- 201
2021
- 202
2022
- 203
2023
- 204
2024
- 205
2025
- 206
2026
- 207
2027
- 208
2028
- 209
2029
- 210
2030
- 211
2031
- 212
2032
2125
  213
2033
2126
  214
2034
2127
  215
@@ -2043,10 +2136,25 @@
2043
2136
  224
2044
2137
  225
2045
2138
  226
2046
- 227</pre>
2139
+ 227
2140
+ 228
2141
+ 229
2142
+ 230
2143
+ 231
2144
+ 232
2145
+ 233
2146
+ 234
2147
+ 235
2148
+ 236
2149
+ 237
2150
+ 238
2151
+ 239
2152
+ 240
2153
+ 241
2154
+ 242</pre>
2047
2155
  </td>
2048
2156
  <td>
2049
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 198</span>
2157
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 213</span>
2050
2158
 
2051
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>
2052
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>
@@ -2120,12 +2228,12 @@
2120
2228
  <pre class="lines">
2121
2229
 
2122
2230
 
2123
- 162
2124
- 163
2125
- 164</pre>
2231
+ 177
2232
+ 178
2233
+ 179</pre>
2126
2234
  </td>
2127
2235
  <td>
2128
- <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 162</span>
2236
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/browser.rb', line 177</span>
2129
2237
 
2130
2238
  <span class='kw'>def</span> <span class='id identifier rubyid_websocket_endpoint'>websocket_endpoint</span>
2131
2239
  <span class='ivar'>@connection</span><span class='period'>.</span><span class='id identifier rubyid_url'>url</span>
@@ -2140,7 +2248,7 @@
2140
2248
  </div>
2141
2249
 
2142
2250
  <div id="footer">
2143
- Generated on Sun Apr 26 15:52:56 2020 by
2251
+ Generated on Sat Jun 20 17:15:06 2020 by
2144
2252
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2145
2253
  0.9.24 (ruby-2.6.3).
2146
2254
  </div>