puppeteer-ruby 0.0.11 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +0 -12
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/README.md +54 -1
  6. data/lib/puppeteer.rb +39 -13
  7. data/lib/puppeteer/browser.rb +22 -25
  8. data/lib/puppeteer/cdp_session.rb +3 -19
  9. data/lib/puppeteer/concurrent_ruby_utils.rb +12 -2
  10. data/lib/puppeteer/connection.rb +3 -15
  11. data/lib/puppeteer/define_async_method.rb +23 -0
  12. data/lib/puppeteer/dom_world.rb +51 -65
  13. data/lib/puppeteer/element_handle.rb +15 -44
  14. data/lib/puppeteer/emulation_manager.rb +2 -6
  15. data/lib/puppeteer/event_callbackable.rb +11 -0
  16. data/lib/puppeteer/execution_context.rb +1 -6
  17. data/lib/puppeteer/frame.rb +34 -39
  18. data/lib/puppeteer/frame_manager.rb +7 -25
  19. data/lib/puppeteer/js_handle.rb +3 -12
  20. data/lib/puppeteer/keyboard.rb +6 -27
  21. data/lib/puppeteer/launcher.rb +6 -6
  22. data/lib/puppeteer/launcher/chrome.rb +10 -8
  23. data/lib/puppeteer/mouse.rb +5 -25
  24. data/lib/puppeteer/network_manager.rb +163 -5
  25. data/lib/puppeteer/page.rb +230 -177
  26. data/lib/puppeteer/page/pdf_options.rb +166 -0
  27. data/lib/puppeteer/remote_object.rb +2 -5
  28. data/lib/puppeteer/request.rb +336 -0
  29. data/lib/puppeteer/response.rb +113 -0
  30. data/lib/puppeteer/target.rb +1 -1
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +2 -4
  34. data/lib/puppeteer/web_socket_transport.rb +8 -8
  35. data/puppeteer-ruby.gemspec +1 -1
  36. data/puppeteer-ruby.png +0 -0
  37. metadata +11 -105
  38. data/Dockerfile +0 -6
  39. data/docker-compose.yml +0 -15
  40. data/docs/Puppeteer.html +0 -2020
  41. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  42. data/docs/Puppeteer/Browser.html +0 -2258
  43. data/docs/Puppeteer/BrowserContext.html +0 -809
  44. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  45. data/docs/Puppeteer/BrowserRunner.html +0 -914
  46. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  47. data/docs/Puppeteer/CDPSession.html +0 -813
  48. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  49. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -430
  50. data/docs/Puppeteer/Connection.html +0 -964
  51. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  52. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  53. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  54. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  55. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  56. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  57. data/docs/Puppeteer/DOMWorld.html +0 -2219
  58. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  59. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  60. data/docs/Puppeteer/DebugPrint.html +0 -233
  61. data/docs/Puppeteer/Device.html +0 -470
  62. data/docs/Puppeteer/Devices.html +0 -139
  63. data/docs/Puppeteer/ElementHandle.html +0 -2542
  64. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  65. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  66. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  67. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  68. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  69. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  70. data/docs/Puppeteer/EmulationManager.html +0 -454
  71. data/docs/Puppeteer/EventCallbackable.html +0 -433
  72. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  73. data/docs/Puppeteer/ExecutionContext.html +0 -998
  74. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  75. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  76. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  77. data/docs/Puppeteer/FileChooser.html +0 -455
  78. data/docs/Puppeteer/Frame.html +0 -3813
  79. data/docs/Puppeteer/FrameManager.html +0 -2410
  80. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  81. data/docs/Puppeteer/IfPresent.html +0 -222
  82. data/docs/Puppeteer/JSHandle.html +0 -1352
  83. data/docs/Puppeteer/Keyboard.html +0 -1557
  84. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  85. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  86. data/docs/Puppeteer/Launcher.html +0 -237
  87. data/docs/Puppeteer/Launcher/Base.html +0 -385
  88. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  89. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  90. data/docs/Puppeteer/Launcher/Chrome.html +0 -669
  91. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  92. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  93. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  94. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  95. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  96. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  97. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  98. data/docs/Puppeteer/Mouse.html +0 -1095
  99. data/docs/Puppeteer/Mouse/Button.html +0 -136
  100. data/docs/Puppeteer/NetworkManager.html +0 -901
  101. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  102. data/docs/Puppeteer/Page.html +0 -5970
  103. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  104. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  105. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  106. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  107. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  108. data/docs/Puppeteer/RemoteObject.html +0 -1087
  109. data/docs/Puppeteer/Target.html +0 -1336
  110. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  111. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  112. data/docs/Puppeteer/TimeoutError.html +0 -135
  113. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  114. data/docs/Puppeteer/TouchScreen.html +0 -464
  115. data/docs/Puppeteer/Viewport.html +0 -837
  116. data/docs/Puppeteer/WaitTask.html +0 -637
  117. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  118. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  119. data/docs/Puppeteer/WebSocket.html +0 -673
  120. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  121. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  122. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  123. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  124. data/docs/_index.html +0 -816
  125. data/docs/class_list.html +0 -51
  126. data/docs/css/common.css +0 -1
  127. data/docs/css/full_list.css +0 -58
  128. data/docs/css/style.css +0 -496
  129. data/docs/file.README.html +0 -123
  130. data/docs/file_list.html +0 -56
  131. data/docs/frames.html +0 -17
  132. data/docs/index.html +0 -123
  133. data/docs/js/app.js +0 -314
  134. data/docs/js/full_list.js +0 -216
  135. data/docs/js/jquery.js +0 -4
  136. data/docs/method_list.html +0 -4091
  137. data/docs/top-level-namespace.html +0 -126
  138. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,124 +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
- Exception: Puppeteer::WaitTask::TerminatedError
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::WaitTask::TerminatedError";
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 (T)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../WaitTask.html" title="Puppeteer::WaitTask (class)">WaitTask</a></span></span>
41
- &raquo;
42
- <span class="title">TerminatedError</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>Exception: Puppeteer::WaitTask::TerminatedError
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">StandardError</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">StandardError</li>
78
-
79
- <li class="next">Puppeteer::WaitTask::TerminatedError</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/puppeteer/wait_task.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- </div>
115
-
116
- <div id="footer">
117
- Generated on Sat Jun 20 17:15:07 2020 by
118
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
- 0.9.24 (ruby-2.6.3).
120
- </div>
121
-
122
- </div>
123
- </body>
124
- </html>
@@ -1,206 +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
- Exception: Puppeteer::WaitTask::TimeoutError
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::WaitTask::TimeoutError";
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 (T)</a> &raquo;
40
- <span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../WaitTask.html" title="Puppeteer::WaitTask (class)">WaitTask</a></span></span>
41
- &raquo;
42
- <span class="title">TimeoutError</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>Exception: Puppeteer::WaitTask::TimeoutError
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">StandardError</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">StandardError</li>
78
-
79
- <li class="next">Puppeteer::WaitTask::TimeoutError</li>
80
-
81
- </ul>
82
- <a href="#" class="inheritanceTree">show all</a>
83
-
84
- </dd>
85
- </dl>
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- <dl>
98
- <dt>Defined in:</dt>
99
- <dd>lib/puppeteer/wait_task.rb</dd>
100
- </dl>
101
-
102
- </div>
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
- <h2>
113
- Instance Method Summary
114
- <small><a href="#" class="summary_toggle">collapse</a></small>
115
- </h2>
116
-
117
- <ul class="summary">
118
-
119
- <li class="public ">
120
- <span class="summary_signature">
121
-
122
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(title:, timeout:) &#x21d2; TimeoutError </a>
123
-
124
-
125
-
126
- </span>
127
-
128
-
129
- <span class="note title constructor">constructor</span>
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
- <span class="summary_desc"><div class='inline'>
139
- <p>A new instance of TimeoutError.</p>
140
- </div></span>
141
-
142
- </li>
143
-
144
-
145
- </ul>
146
-
147
-
148
-
149
- <div id="constructor_details" class="method_details_list">
150
- <h2>Constructor Details</h2>
151
-
152
- <div class="method_details first">
153
- <h3 class="signature first" id="initialize-instance_method">
154
-
155
- #<strong>initialize</strong>(title:, timeout:) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::WaitTask::TimeoutError (class)">TimeoutError</a></span></tt>
156
-
157
-
158
-
159
-
160
-
161
- </h3><div class="docstring">
162
- <div class="discussion">
163
-
164
- <p>Returns a new instance of TimeoutError.</p>
165
-
166
-
167
- </div>
168
- </div>
169
- <div class="tags">
170
-
171
-
172
- </div><table class="source_code">
173
- <tr>
174
- <td>
175
- <pre class="lines">
176
-
177
-
178
- 7
179
- 8
180
- 9</pre>
181
- </td>
182
- <td>
183
- <pre class="code"><span class="info file"># File 'lib/puppeteer/wait_task.rb', line 7</span>
184
-
185
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>title:</span><span class='comma'>,</span> <span class='label'>timeout:</span><span class='rparen'>)</span>
186
- <span class='kw'>super</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>waiting for </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_title'>title</span><span class='embexpr_end'>}</span><span class='tstring_content'> failed: timeout </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_timeout'>timeout</span><span class='embexpr_end'>}</span><span class='tstring_content'>ms exceeded</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
187
- <span class='kw'>end</span></pre>
188
- </td>
189
- </tr>
190
- </table>
191
- </div>
192
-
193
- </div>
194
-
195
-
196
- </div>
197
-
198
- <div id="footer">
199
- Generated on Sat Jun 20 17:15:07 2020 by
200
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
201
- 0.9.24 (ruby-2.6.3).
202
- </div>
203
-
204
- </div>
205
- </body>
206
- </html>
@@ -1,673 +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::WebSocket
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::WebSocket";
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 (W)</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">WebSocket</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::WebSocket
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::WebSocket</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/puppeteer/web_socket.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>ref: <a href="https://github.com/rails/rails/blob/master/actioncable/lib/action_cable/connection/client_socket.rb">github.com/rails/rails/blob/master/actioncable/lib/action_cable/connection/client_socket.rb</a> ref: <a href="https://github.com/cavalle/chrome_remote/blob/master/lib/chrome_remote/web_socket_client.rb">github.com/cavalle/chrome_remote/blob/master/lib/chrome_remote/web_socket_client.rb</a></p>
106
-
107
-
108
- </div>
109
- </div>
110
- <div class="tags">
111
-
112
-
113
- </div><h2>Defined Under Namespace</h2>
114
- <p class="children">
115
-
116
-
117
-
118
-
119
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="WebSocket/DriverImpl.html" title="Puppeteer::WebSocket::DriverImpl (class)">DriverImpl</a></span>, <span class='object_link'><a href="WebSocket/TransportError.html" title="Puppeteer::WebSocket::TransportError (class)">TransportError</a></span>
120
-
121
-
122
- </p>
123
-
124
-
125
- <h2>
126
- Constant Summary
127
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
128
- </h2>
129
-
130
- <dl class="constants">
131
-
132
- <dt id="STATE_CONNECTING-constant" class="">STATE_CONNECTING =
133
-
134
- </dt>
135
- <dd><pre class="code"><span class='int'>0</span></pre></dd>
136
-
137
- <dt id="STATE_OPENED-constant" class="">STATE_OPENED =
138
-
139
- </dt>
140
- <dd><pre class="code"><span class='int'>1</span></pre></dd>
141
-
142
- <dt id="STATE_CLOSING-constant" class="">STATE_CLOSING =
143
-
144
- </dt>
145
- <dd><pre class="code"><span class='int'>2</span></pre></dd>
146
-
147
- <dt id="STATE_CLOSED-constant" class="">STATE_CLOSED =
148
-
149
- </dt>
150
- <dd><pre class="code"><span class='int'>3</span></pre></dd>
151
-
152
- </dl>
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
- <h2>
163
- Instance Method Summary
164
- <small><a href="#" class="summary_toggle">collapse</a></small>
165
- </h2>
166
-
167
- <ul class="summary">
168
-
169
- <li class="public ">
170
- <span class="summary_signature">
171
-
172
- <a href="#close-instance_method" title="#close (instance method)">#<strong>close</strong>(code: 1000, reason: &quot;&quot;) &#x21d2; Object </a>
173
-
174
-
175
-
176
- </span>
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
- <span class="summary_desc"><div class='inline'></div></span>
187
-
188
- </li>
189
-
190
-
191
- <li class="public ">
192
- <span class="summary_signature">
193
-
194
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(url:, max_payload_size:) &#x21d2; WebSocket </a>
195
-
196
-
197
-
198
- </span>
199
-
200
-
201
- <span class="note title constructor">constructor</span>
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
- <span class="summary_desc"><div class='inline'>
211
- <p>A new instance of WebSocket.</p>
212
- </div></span>
213
-
214
- </li>
215
-
216
-
217
- <li class="public ">
218
- <span class="summary_signature">
219
-
220
- <a href="#on_close-instance_method" title="#on_close (instance method)">#<strong>on_close</strong>(&amp;block) &#x21d2; Object </a>
221
-
222
-
223
-
224
- </span>
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
- <span class="summary_desc"><div class='inline'></div></span>
235
-
236
- </li>
237
-
238
-
239
- <li class="public ">
240
- <span class="summary_signature">
241
-
242
- <a href="#on_error-instance_method" title="#on_error (instance method)">#<strong>on_error</strong>(&amp;block) &#x21d2; Object </a>
243
-
244
-
245
-
246
- </span>
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
- <span class="summary_desc"><div class='inline'></div></span>
257
-
258
- </li>
259
-
260
-
261
- <li class="public ">
262
- <span class="summary_signature">
263
-
264
- <a href="#on_message-instance_method" title="#on_message (instance method)">#<strong>on_message</strong>(&amp;block) &#x21d2; Object </a>
265
-
266
-
267
-
268
- </span>
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
- <span class="summary_desc"><div class='inline'></div></span>
279
-
280
- </li>
281
-
282
-
283
- <li class="public ">
284
- <span class="summary_signature">
285
-
286
- <a href="#on_open-instance_method" title="#on_open (instance method)">#<strong>on_open</strong>(&amp;block) &#x21d2; Object </a>
287
-
288
-
289
-
290
- </span>
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
- <span class="summary_desc"><div class='inline'></div></span>
301
-
302
- </li>
303
-
304
-
305
- <li class="public ">
306
- <span class="summary_signature">
307
-
308
- <a href="#send_text-instance_method" title="#send_text (instance method)">#<strong>send_text</strong>(message) &#x21d2; Object </a>
309
-
310
-
311
-
312
- </span>
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
- <span class="summary_desc"><div class='inline'></div></span>
323
-
324
- </li>
325
-
326
-
327
- </ul>
328
-
329
-
330
- <div id="constructor_details" class="method_details_list">
331
- <h2>Constructor Details</h2>
332
-
333
- <div class="method_details first">
334
- <h3 class="signature first" id="initialize-instance_method">
335
-
336
- #<strong>initialize</strong>(url:, max_payload_size:) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::WebSocket (class)">WebSocket</a></span></tt>
337
-
338
-
339
-
340
-
341
-
342
- </h3><div class="docstring">
343
- <div class="discussion">
344
-
345
- <p>Returns a new instance of WebSocket.</p>
346
-
347
-
348
- </div>
349
- </div>
350
- <div class="tags">
351
-
352
-
353
- </div><table class="source_code">
354
- <tr>
355
- <td>
356
- <pre class="lines">
357
-
358
-
359
- 31
360
- 32
361
- 33
362
- 34
363
- 35
364
- 36
365
- 37
366
- 38
367
- 39
368
- 40
369
- 41
370
- 42
371
- 43
372
- 44</pre>
373
- </td>
374
- <td>
375
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 31</span>
376
-
377
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>url:</span><span class='comma'>,</span> <span class='label'>max_payload_size:</span><span class='rparen'>)</span>
378
- <span class='ivar'>@impl</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="WebSocket/DriverImpl.html" title="Puppeteer::WebSocket::DriverImpl (class)">DriverImpl</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="WebSocket/DriverImpl.html#initialize-instance_method" title="Puppeteer::WebSocket::DriverImpl#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
379
- <span class='ivar'>@driver</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>WebSocket</span><span class='op'>::</span><span class='const'>Driver</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='lparen'>(</span><span class='ivar'>@impl</span><span class='comma'>,</span> <span class='label'>max_length:</span> <span class='id identifier rubyid_max_payload_size'>max_payload_size</span><span class='rparen'>)</span>
380
-
381
- <span class='id identifier rubyid_setup'>setup</span>
382
- <span class='ivar'>@driver</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
383
-
384
- <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='kw'>do</span>
385
- <span class='id identifier rubyid_wait_for_data'>wait_for_data</span> <span class='kw'>until</span> <span class='ivar'>@ready_state</span> <span class='op'>&gt;=</span> <span class='const'><span class='object_link'><a href="#STATE_CLOSING-constant" title="Puppeteer::WebSocket::STATE_CLOSING (constant)">STATE_CLOSING</a></span></span>
386
- <span class='kw'>rescue</span> <span class='const'>EOFError</span>
387
- <span class='comment'># Google Chrome was gone.
388
- </span> <span class='comment'># We have nothing todo. Just finish polling.
389
- </span> <span class='kw'>end</span>
390
- <span class='kw'>end</span></pre>
391
- </td>
392
- </tr>
393
- </table>
394
- </div>
395
-
396
- </div>
397
-
398
-
399
- <div id="instance_method_details" class="method_details_list">
400
- <h2>Instance Method Details</h2>
401
-
402
-
403
- <div class="method_details first">
404
- <h3 class="signature first" id="close-instance_method">
405
-
406
- #<strong>close</strong>(code: 1000, reason: &quot;&quot;) &#x21d2; <tt>Object</tt>
407
-
408
-
409
-
410
-
411
-
412
- </h3><table class="source_code">
413
- <tr>
414
- <td>
415
- <pre class="lines">
416
-
417
-
418
- 78
419
- 79
420
- 80
421
- 81
422
- 82</pre>
423
- </td>
424
- <td>
425
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 78</span>
426
-
427
- <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span><span class='lparen'>(</span><span class='label'>code:</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
428
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@ready_state</span> <span class='op'>&gt;=</span> <span class='const'><span class='object_link'><a href="#STATE_CLOSING-constant" title="Puppeteer::WebSocket::STATE_CLOSING (constant)">STATE_CLOSING</a></span></span>
429
- <span class='ivar'>@ready_state</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#STATE_CLOSING-constant" title="Puppeteer::WebSocket::STATE_CLOSING (constant)">STATE_CLOSING</a></span></span>
430
- <span class='ivar'>@driver</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span><span class='lparen'>(</span><span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span>
431
- <span class='kw'>end</span></pre>
432
- </td>
433
- </tr>
434
- </table>
435
- </div>
436
-
437
- <div class="method_details ">
438
- <h3 class="signature " id="on_close-instance_method">
439
-
440
- #<strong>on_close</strong>(&amp;block) &#x21d2; <tt>Object</tt>
441
-
442
-
443
-
444
-
445
-
446
- </h3><div class="docstring">
447
- <div class="discussion">
448
-
449
-
450
- </div>
451
- </div>
452
- <div class="tags">
453
- <p class="tag_title">Parameters:</p>
454
- <ul class="param">
455
-
456
- <li>
457
-
458
- <span class='name'>block</span>
459
-
460
-
461
- <span class='type'>(<tt>Proc(reason: String, code: Numeric)</tt>)</span>
462
-
463
-
464
-
465
- </li>
466
-
467
- </ul>
468
-
469
-
470
- </div><table class="source_code">
471
- <tr>
472
- <td>
473
- <pre class="lines">
474
-
475
-
476
- 89
477
- 90
478
- 91</pre>
479
- </td>
480
- <td>
481
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 89</span>
482
-
483
- <span class='kw'>def</span> <span class='id identifier rubyid_on_close'>on_close</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
484
- <span class='ivar'>@on_close</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
485
- <span class='kw'>end</span></pre>
486
- </td>
487
- </tr>
488
- </table>
489
- </div>
490
-
491
- <div class="method_details ">
492
- <h3 class="signature " id="on_error-instance_method">
493
-
494
- #<strong>on_error</strong>(&amp;block) &#x21d2; <tt>Object</tt>
495
-
496
-
497
-
498
-
499
-
500
- </h3><div class="docstring">
501
- <div class="discussion">
502
-
503
-
504
- </div>
505
- </div>
506
- <div class="tags">
507
- <p class="tag_title">Parameters:</p>
508
- <ul class="param">
509
-
510
- <li>
511
-
512
- <span class='name'>block</span>
513
-
514
-
515
- <span class='type'>(<tt>Proc(error_message: String)</tt>)</span>
516
-
517
-
518
-
519
- </li>
520
-
521
- </ul>
522
-
523
-
524
- </div><table class="source_code">
525
- <tr>
526
- <td>
527
- <pre class="lines">
528
-
529
-
530
- 94
531
- 95
532
- 96</pre>
533
- </td>
534
- <td>
535
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 94</span>
536
-
537
- <span class='kw'>def</span> <span class='id identifier rubyid_on_error'>on_error</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
538
- <span class='ivar'>@on_error</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
539
- <span class='kw'>end</span></pre>
540
- </td>
541
- </tr>
542
- </table>
543
- </div>
544
-
545
- <div class="method_details ">
546
- <h3 class="signature " id="on_message-instance_method">
547
-
548
- #<strong>on_message</strong>(&amp;block) &#x21d2; <tt>Object</tt>
549
-
550
-
551
-
552
-
553
-
554
- </h3><table class="source_code">
555
- <tr>
556
- <td>
557
- <pre class="lines">
558
-
559
-
560
- 98
561
- 99
562
- 100</pre>
563
- </td>
564
- <td>
565
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 98</span>
566
-
567
- <span class='kw'>def</span> <span class='id identifier rubyid_on_message'>on_message</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
568
- <span class='ivar'>@on_message</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
569
- <span class='kw'>end</span></pre>
570
- </td>
571
- </tr>
572
- </table>
573
- </div>
574
-
575
- <div class="method_details ">
576
- <h3 class="signature " id="on_open-instance_method">
577
-
578
- #<strong>on_open</strong>(&amp;block) &#x21d2; <tt>Object</tt>
579
-
580
-
581
-
582
-
583
-
584
- </h3><table class="source_code">
585
- <tr>
586
- <td>
587
- <pre class="lines">
588
-
589
-
590
- 84
591
- 85
592
- 86</pre>
593
- </td>
594
- <td>
595
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 84</span>
596
-
597
- <span class='kw'>def</span> <span class='id identifier rubyid_on_open'>on_open</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
598
- <span class='ivar'>@on_open</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span>
599
- <span class='kw'>end</span></pre>
600
- </td>
601
- </tr>
602
- </table>
603
- </div>
604
-
605
- <div class="method_details ">
606
- <h3 class="signature " id="send_text-instance_method">
607
-
608
- #<strong>send_text</strong>(message) &#x21d2; <tt>Object</tt>
609
-
610
-
611
-
612
-
613
-
614
- </h3><div class="docstring">
615
- <div class="discussion">
616
-
617
-
618
- </div>
619
- </div>
620
- <div class="tags">
621
- <p class="tag_title">Parameters:</p>
622
- <ul class="param">
623
-
624
- <li>
625
-
626
- <span class='name'>message</span>
627
-
628
-
629
- <span class='type'>(<tt>String</tt>)</span>
630
-
631
-
632
-
633
- </li>
634
-
635
- </ul>
636
-
637
-
638
- </div><table class="source_code">
639
- <tr>
640
- <td>
641
- <pre class="lines">
642
-
643
-
644
- 73
645
- 74
646
- 75
647
- 76</pre>
648
- </td>
649
- <td>
650
- <pre class="code"><span class="info file"># File 'lib/puppeteer/web_socket.rb', line 73</span>
651
-
652
- <span class='kw'>def</span> <span class='id identifier rubyid_send_text'>send_text</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
653
- <span class='kw'>return</span> <span class='kw'>if</span> <span class='ivar'>@ready_state</span> <span class='op'>&gt;=</span> <span class='const'><span class='object_link'><a href="#STATE_CLOSING-constant" title="Puppeteer::WebSocket::STATE_CLOSING (constant)">STATE_CLOSING</a></span></span>
654
- <span class='ivar'>@driver</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
655
- <span class='kw'>end</span></pre>
656
- </td>
657
- </tr>
658
- </table>
659
- </div>
660
-
661
- </div>
662
-
663
- </div>
664
-
665
- <div id="footer">
666
- Generated on Sat Jun 20 17:15:07 2020 by
667
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
668
- 0.9.24 (ruby-2.6.3).
669
- </div>
670
-
671
- </div>
672
- </body>
673
- </html>