puppeteer-ruby 0.0.12 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -14
  3. data/.github/workflows/docs.yml +45 -0
  4. data/.github/workflows/reviewdog.yml +15 -0
  5. data/README.md +52 -1
  6. data/lib/puppeteer.rb +10 -2
  7. data/lib/puppeteer/browser.rb +53 -34
  8. data/lib/puppeteer/browser_context.rb +35 -5
  9. data/lib/puppeteer/cdp_session.rb +3 -19
  10. data/lib/puppeteer/concurrent_ruby_utils.rb +6 -0
  11. data/lib/puppeteer/connection.rb +9 -16
  12. data/lib/puppeteer/debug_print.rb +1 -1
  13. data/lib/puppeteer/define_async_method.rb +23 -0
  14. data/lib/puppeteer/dom_world.rb +67 -78
  15. data/lib/puppeteer/element_handle.rb +19 -47
  16. data/lib/puppeteer/emulation_manager.rb +2 -6
  17. data/lib/puppeteer/env.rb +18 -0
  18. data/lib/puppeteer/execution_context.rb +1 -6
  19. data/lib/puppeteer/frame.rb +34 -39
  20. data/lib/puppeteer/frame_manager.rb +7 -25
  21. data/lib/puppeteer/js_handle.rb +3 -12
  22. data/lib/puppeteer/keyboard.rb +9 -29
  23. data/lib/puppeteer/launcher/chrome.rb +9 -7
  24. data/lib/puppeteer/mouse.rb +20 -24
  25. data/lib/puppeteer/network_manager.rb +163 -5
  26. data/lib/puppeteer/page.rb +213 -179
  27. data/lib/puppeteer/page/pdf_options.rb +166 -0
  28. data/lib/puppeteer/remote_object.rb +2 -5
  29. data/lib/puppeteer/request.rb +330 -0
  30. data/lib/puppeteer/response.rb +113 -0
  31. data/lib/puppeteer/touch_screen.rb +2 -7
  32. data/lib/puppeteer/version.rb +1 -1
  33. data/lib/puppeteer/wait_task.rb +2 -4
  34. data/lib/puppeteer/web_socket.rb +7 -0
  35. data/puppeteer-ruby.gemspec +2 -1
  36. metadata +25 -103
  37. data/docs/Puppeteer.html +0 -2338
  38. data/docs/Puppeteer/AsyncAwaitBehavior.html +0 -105
  39. data/docs/Puppeteer/Browser.html +0 -2258
  40. data/docs/Puppeteer/BrowserContext.html +0 -809
  41. data/docs/Puppeteer/BrowserFetcher.html +0 -214
  42. data/docs/Puppeteer/BrowserRunner.html +0 -914
  43. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +0 -477
  44. data/docs/Puppeteer/CDPSession.html +0 -813
  45. data/docs/Puppeteer/CDPSession/Error.html +0 -124
  46. data/docs/Puppeteer/ConcurrentRubyUtils.html +0 -438
  47. data/docs/Puppeteer/Connection.html +0 -964
  48. data/docs/Puppeteer/Connection/MessageCallback.html +0 -434
  49. data/docs/Puppeteer/Connection/ProtocolError.html +0 -216
  50. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +0 -217
  51. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +0 -244
  52. data/docs/Puppeteer/ConsoleMessage.html +0 -565
  53. data/docs/Puppeteer/ConsoleMessage/Location.html +0 -433
  54. data/docs/Puppeteer/DOMWorld.html +0 -2219
  55. data/docs/Puppeteer/DOMWorld/DetachedError.html +0 -124
  56. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +0 -124
  57. data/docs/Puppeteer/DebugPrint.html +0 -233
  58. data/docs/Puppeteer/Device.html +0 -470
  59. data/docs/Puppeteer/Devices.html +0 -139
  60. data/docs/Puppeteer/ElementHandle.html +0 -2542
  61. data/docs/Puppeteer/ElementHandle/BoundingBox.html +0 -507
  62. data/docs/Puppeteer/ElementHandle/BoxModel.html +0 -404
  63. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +0 -206
  64. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +0 -206
  65. data/docs/Puppeteer/ElementHandle/Point.html +0 -492
  66. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +0 -124
  67. data/docs/Puppeteer/EmulationManager.html +0 -454
  68. data/docs/Puppeteer/EventCallbackable.html +0 -499
  69. data/docs/Puppeteer/EventCallbackable/EventListeners.html +0 -435
  70. data/docs/Puppeteer/ExecutionContext.html +0 -998
  71. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +0 -124
  72. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +0 -357
  73. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +0 -389
  74. data/docs/Puppeteer/FileChooser.html +0 -455
  75. data/docs/Puppeteer/Frame.html +0 -3813
  76. data/docs/Puppeteer/FrameManager.html +0 -2410
  77. data/docs/Puppeteer/FrameManager/NavigationError.html +0 -124
  78. data/docs/Puppeteer/IfPresent.html +0 -222
  79. data/docs/Puppeteer/JSHandle.html +0 -1352
  80. data/docs/Puppeteer/Keyboard.html +0 -1557
  81. data/docs/Puppeteer/Keyboard/KeyDefinition.html +0 -831
  82. data/docs/Puppeteer/Keyboard/KeyDescription.html +0 -603
  83. data/docs/Puppeteer/Launcher.html +0 -237
  84. data/docs/Puppeteer/Launcher/Base.html +0 -385
  85. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +0 -124
  86. data/docs/Puppeteer/Launcher/BrowserOptions.html +0 -441
  87. data/docs/Puppeteer/Launcher/Chrome.html +0 -669
  88. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +0 -382
  89. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +0 -531
  90. data/docs/Puppeteer/Launcher/LaunchOptions.html +0 -893
  91. data/docs/Puppeteer/LifecycleWatcher.html +0 -834
  92. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +0 -363
  93. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +0 -206
  94. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +0 -124
  95. data/docs/Puppeteer/Mouse.html +0 -1095
  96. data/docs/Puppeteer/Mouse/Button.html +0 -136
  97. data/docs/Puppeteer/NetworkManager.html +0 -901
  98. data/docs/Puppeteer/NetworkManager/Credentials.html +0 -385
  99. data/docs/Puppeteer/Page.html +0 -6173
  100. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +0 -206
  101. data/docs/Puppeteer/Page/ScreenshotOptions.html +0 -845
  102. data/docs/Puppeteer/Page/ScriptTag.html +0 -555
  103. data/docs/Puppeteer/Page/StyleTag.html +0 -448
  104. data/docs/Puppeteer/Page/TargetCrashedError.html +0 -124
  105. data/docs/Puppeteer/RemoteObject.html +0 -1087
  106. data/docs/Puppeteer/Target.html +0 -1336
  107. data/docs/Puppeteer/Target/InitializeFailure.html +0 -124
  108. data/docs/Puppeteer/Target/TargetInfo.html +0 -729
  109. data/docs/Puppeteer/TimeoutError.html +0 -135
  110. data/docs/Puppeteer/TimeoutSettings.html +0 -496
  111. data/docs/Puppeteer/TouchScreen.html +0 -464
  112. data/docs/Puppeteer/Viewport.html +0 -837
  113. data/docs/Puppeteer/WaitTask.html +0 -637
  114. data/docs/Puppeteer/WaitTask/TerminatedError.html +0 -124
  115. data/docs/Puppeteer/WaitTask/TimeoutError.html +0 -206
  116. data/docs/Puppeteer/WebSocket.html +0 -673
  117. data/docs/Puppeteer/WebSocket/DriverImpl.html +0 -412
  118. data/docs/Puppeteer/WebSocket/TransportError.html +0 -124
  119. data/docs/Puppeteer/WebSocketTransport.html +0 -600
  120. data/docs/Puppeteer/WebSocktTransportError.html +0 -124
  121. data/docs/_index.html +0 -816
  122. data/docs/class_list.html +0 -51
  123. data/docs/css/common.css +0 -1
  124. data/docs/css/full_list.css +0 -58
  125. data/docs/css/style.css +0 -496
  126. data/docs/file.README.html +0 -125
  127. data/docs/file_list.html +0 -56
  128. data/docs/frames.html +0 -17
  129. data/docs/index.html +0 -125
  130. data/docs/js/app.js +0 -314
  131. data/docs/js/full_list.js +0 -216
  132. data/docs/js/jquery.js +0 -4
  133. data/docs/method_list.html +0 -4115
  134. data/docs/top-level-namespace.html +0 -126
  135. data/lib/puppeteer/async_await_behavior.rb +0 -38
@@ -1,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::Page::FileChooserTimeoutError
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::Page::FileChooserTimeoutError";
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 (F)</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="../Page.html" title="Puppeteer::Page (class)">Page</a></span></span>
41
- &raquo;
42
- <span class="title">FileChooserTimeoutError</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::Page::FileChooserTimeoutError
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::Page::FileChooserTimeoutError</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/page.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>(timeout:) &#x21d2; FileChooserTimeoutError </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 FileChooserTimeoutError.</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>(timeout:) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::Page::FileChooserTimeoutError (class)">FileChooserTimeoutError</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 FileChooserTimeoutError.</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
- 181
179
- 182
180
- 183</pre>
181
- </td>
182
- <td>
183
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page.rb', line 181</span>
184
-
185
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</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 filechooser 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 Tue Jun 23 10:24:58 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,845 +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::Page::ScreenshotOptions
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::Page::ScreenshotOptions";
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 (S)</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="../Page.html" title="Puppeteer::Page (class)">Page</a></span></span>
41
- &raquo;
42
- <span class="title">ScreenshotOptions</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::Page::ScreenshotOptions
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::Page::ScreenshotOptions</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/page/screenshot_options.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>/**</p>
106
-
107
- <pre class="code ruby"><code class="ruby">* @typedef {Object} ScreenshotOptions
108
- * @property {string=} type
109
- * @property {string=} path
110
- * @property {boolean=} fullPage
111
- * @property {{x: number, y: number, width: number, height: number}=} clip
112
- * @property {number=} quality
113
- * @property {boolean=} omitBackground
114
- * @property {string=} encoding
115
- */
116
- </code></pre>
117
-
118
-
119
- </div>
120
- </div>
121
- <div class="tags">
122
-
123
-
124
- </div>
125
-
126
-
127
-
128
- <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
129
- <ul class="summary">
130
-
131
- <li class="public ">
132
- <span class="summary_signature">
133
-
134
- <a href="#clip-instance_method" title="#clip (instance method)">#<strong>clip</strong> &#x21d2; Object </a>
135
-
136
-
137
-
138
- </span>
139
-
140
-
141
-
142
-
143
- <span class="note title readonly">readonly</span>
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- <span class="summary_desc"><div class='inline'>
154
- <p>Returns the value of attribute clip.</p>
155
- </div></span>
156
-
157
- </li>
158
-
159
-
160
- <li class="public ">
161
- <span class="summary_signature">
162
-
163
- <a href="#encoding-instance_method" title="#encoding (instance method)">#<strong>encoding</strong> &#x21d2; Object </a>
164
-
165
-
166
-
167
- </span>
168
-
169
-
170
-
171
-
172
- <span class="note title readonly">readonly</span>
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
- <span class="summary_desc"><div class='inline'>
183
- <p>Returns the value of attribute encoding.</p>
184
- </div></span>
185
-
186
- </li>
187
-
188
-
189
- <li class="public ">
190
- <span class="summary_signature">
191
-
192
- <a href="#path-instance_method" title="#path (instance method)">#<strong>path</strong> &#x21d2; Object </a>
193
-
194
-
195
-
196
- </span>
197
-
198
-
199
-
200
-
201
- <span class="note title readonly">readonly</span>
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
- <span class="summary_desc"><div class='inline'>
212
- <p>Returns the value of attribute path.</p>
213
- </div></span>
214
-
215
- </li>
216
-
217
-
218
- <li class="public ">
219
- <span class="summary_signature">
220
-
221
- <a href="#quality-instance_method" title="#quality (instance method)">#<strong>quality</strong> &#x21d2; Object </a>
222
-
223
-
224
-
225
- </span>
226
-
227
-
228
-
229
-
230
- <span class="note title readonly">readonly</span>
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
- <span class="summary_desc"><div class='inline'>
241
- <p>Returns the value of attribute quality.</p>
242
- </div></span>
243
-
244
- </li>
245
-
246
-
247
- <li class="public ">
248
- <span class="summary_signature">
249
-
250
- <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
251
-
252
-
253
-
254
- </span>
255
-
256
-
257
-
258
-
259
- <span class="note title readonly">readonly</span>
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
- <span class="summary_desc"><div class='inline'>
270
- <p>Returns the value of attribute type.</p>
271
- </div></span>
272
-
273
- </li>
274
-
275
-
276
- </ul>
277
-
278
-
279
-
280
-
281
-
282
- <h2>
283
- Instance Method Summary
284
- <small><a href="#" class="summary_toggle">collapse</a></small>
285
- </h2>
286
-
287
- <ul class="summary">
288
-
289
- <li class="public ">
290
- <span class="summary_signature">
291
-
292
- <a href="#full_page%3F-instance_method" title="#full_page? (instance method)">#<strong>full_page?</strong> &#x21d2; Boolean </a>
293
-
294
-
295
-
296
- </span>
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
- <span class="summary_desc"><div class='inline'></div></span>
307
-
308
- </li>
309
-
310
-
311
- <li class="public ">
312
- <span class="summary_signature">
313
-
314
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options) &#x21d2; ScreenshotOptions </a>
315
-
316
-
317
-
318
- </span>
319
-
320
-
321
- <span class="note title constructor">constructor</span>
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
- <span class="summary_desc"><div class='inline'>
331
- <p>A new instance of ScreenshotOptions.</p>
332
- </div></span>
333
-
334
- </li>
335
-
336
-
337
- <li class="public ">
338
- <span class="summary_signature">
339
-
340
- <a href="#omit_background%3F-instance_method" title="#omit_background? (instance method)">#<strong>omit_background?</strong> &#x21d2; Boolean </a>
341
-
342
-
343
-
344
- </span>
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
- <span class="summary_desc"><div class='inline'></div></span>
355
-
356
- </li>
357
-
358
-
359
- </ul>
360
-
361
-
362
- <div id="constructor_details" class="method_details_list">
363
- <h2>Constructor Details</h2>
364
-
365
- <div class="method_details first">
366
- <h3 class="signature first" id="initialize-instance_method">
367
-
368
- #<strong>initialize</strong>(options) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::Page::ScreenshotOptions (class)">ScreenshotOptions</a></span></tt>
369
-
370
-
371
-
372
-
373
-
374
- </h3><div class="docstring">
375
- <div class="discussion">
376
-
377
- <p>Returns a new instance of ScreenshotOptions.</p>
378
-
379
-
380
- </div>
381
- </div>
382
- <div class="tags">
383
-
384
-
385
- </div><table class="source_code">
386
- <tr>
387
- <td>
388
- <pre class="lines">
389
-
390
-
391
- 16
392
- 17
393
- 18
394
- 19
395
- 20
396
- 21
397
- 22
398
- 23
399
- 24
400
- 25
401
- 26
402
- 27
403
- 28
404
- 29
405
- 30
406
- 31
407
- 32
408
- 33
409
- 34
410
- 35
411
- 36
412
- 37
413
- 38
414
- 39
415
- 40
416
- 41
417
- 42
418
- 43
419
- 44
420
- 45
421
- 46
422
- 47
423
- 48
424
- 49
425
- 50
426
- 51
427
- 52
428
- 53
429
- 54
430
- 55
431
- 56
432
- 57
433
- 58
434
- 59
435
- 60
436
- 61
437
- 62
438
- 63
439
- 64
440
- 65
441
- 66</pre>
442
- </td>
443
- <td>
444
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 16</span>
445
-
446
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
447
- <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span>
448
- <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='symbol'>:png</span><span class='comma'>,</span> <span class='symbol'>:jpeg</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rparen'>)</span>
449
- <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 options.type value: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
450
- <span class='kw'>end</span>
451
- <span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span>
452
- <span class='kw'>elsif</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span>
453
- <span class='id identifier rubyid_mime_types'>mime_types</span> <span class='op'>=</span> <span class='const'>MIME</span><span class='op'>::</span><span class='const'>Types</span><span class='period'>.</span><span class='id identifier rubyid_type_for'>type_for</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span><span class='rparen'>)</span>
454
- <span class='kw'>if</span> <span class='id identifier rubyid_mime_types'>mime_types</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>image/png</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
455
- <span class='ivar'>@type</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>png</span><span class='tstring_end'>&#39;</span></span>
456
- <span class='kw'>elsif</span> <span class='id identifier rubyid_mime_types'>mime_types</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>image/jpeg</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
457
- <span class='ivar'>@type</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>jpeg</span><span class='tstring_end'>&#39;</span></span>
458
- <span class='kw'>else</span>
459
- <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'>Unsupported screenshot mime type resolved: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_mime_types'>mime_types</span><span class='embexpr_end'>}</span><span class='tstring_content'>, path: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
460
- <span class='kw'>end</span>
461
- <span class='kw'>end</span>
462
- <span class='ivar'>@type</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>png</span><span class='tstring_end'>&#39;</span></span>
463
-
464
- <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:quality</span><span class='rbracket'>]</span>
465
- <span class='kw'>unless</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>png</span><span class='tstring_end'>&#39;</span></span>
466
- <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'>options.quality is unsupported for the </span><span class='embexpr_beg'>#{</span><span class='ivar'>@type</span><span class='embexpr_end'>}</span><span class='tstring_content'> screenshots</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
467
- <span class='kw'>end</span>
468
- <span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:quality</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span>
469
- <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'>Expected options.quality to be a number but found </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:quality</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
470
- <span class='kw'>end</span>
471
- <span class='id identifier rubyid_quality'>quality</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:quality</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
472
- <span class='kw'>unless</span> <span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='int'>100</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_qualizy'>qualizy</span><span class='rparen'>)</span>
473
- <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'>Expected options.quality to be between 0 and 100 (inclusive), got </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_quality'>quality</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
474
- <span class='kw'>end</span>
475
- <span class='ivar'>@quality</span> <span class='op'>=</span> <span class='id identifier rubyid_quality'>quality</span>
476
- <span class='kw'>end</span>
477
-
478
- <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:clip</span><span class='rbracket'>]</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:full_page</span><span class='rbracket'>]</span>
479
- <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'>&#39;</span><span class='tstring_content'>options.clip and options.fullPage are exclusive</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
480
- <span class='kw'>end</span>
481
-
482
- <span class='comment'># if (options.clip) {
483
- </span> <span class='comment'># assert(typeof options.clip.x === &#39;number&#39;, &#39;Expected options.clip.x to be a number but found &#39; + (typeof options.clip.x));
484
- </span> <span class='comment'># assert(typeof options.clip.y === &#39;number&#39;, &#39;Expected options.clip.y to be a number but found &#39; + (typeof options.clip.y));
485
- </span> <span class='comment'># assert(typeof options.clip.width === &#39;number&#39;, &#39;Expected options.clip.width to be a number but found &#39; + (typeof options.clip.width));
486
- </span> <span class='comment'># assert(typeof options.clip.height === &#39;number&#39;, &#39;Expected options.clip.height to be a number but found &#39; + (typeof options.clip.height));
487
- </span> <span class='comment'># assert(options.clip.width !== 0, &#39;Expected options.clip.width not to be 0.&#39;);
488
- </span> <span class='comment'># assert(options.clip.height !== 0, &#39;Expected options.clip.height not to be 0.&#39;);
489
- </span> <span class='comment'># }
490
- </span>
491
- <span class='ivar'>@path</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:path</span><span class='rbracket'>]</span>
492
- <span class='ivar'>@full_page</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:full_page</span><span class='rbracket'>]</span>
493
- <span class='ivar'>@clip</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:clip</span><span class='rbracket'>]</span>
494
- <span class='ivar'>@omit_background</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:omit_background</span><span class='rbracket'>]</span>
495
- <span class='ivar'>@encoding</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:encoding</span><span class='rbracket'>]</span>
496
- <span class='kw'>end</span></pre>
497
- </td>
498
- </tr>
499
- </table>
500
- </div>
501
-
502
- </div>
503
-
504
- <div id="instance_attr_details" class="attr_details">
505
- <h2>Instance Attribute Details</h2>
506
-
507
-
508
- <span id=""></span>
509
- <div class="method_details first">
510
- <h3 class="signature first" id="clip-instance_method">
511
-
512
- #<strong>clip</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
513
-
514
-
515
-
516
-
517
-
518
- </h3><div class="docstring">
519
- <div class="discussion">
520
-
521
- <p>Returns the value of attribute clip.</p>
522
-
523
-
524
- </div>
525
- </div>
526
- <div class="tags">
527
-
528
-
529
- </div><table class="source_code">
530
- <tr>
531
- <td>
532
- <pre class="lines">
533
-
534
-
535
- 68
536
- 69
537
- 70</pre>
538
- </td>
539
- <td>
540
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 68</span>
541
-
542
- <span class='kw'>def</span> <span class='id identifier rubyid_clip'>clip</span>
543
- <span class='ivar'>@clip</span>
544
- <span class='kw'>end</span></pre>
545
- </td>
546
- </tr>
547
- </table>
548
- </div>
549
-
550
-
551
- <span id=""></span>
552
- <div class="method_details ">
553
- <h3 class="signature " id="encoding-instance_method">
554
-
555
- #<strong>encoding</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
556
-
557
-
558
-
559
-
560
-
561
- </h3><div class="docstring">
562
- <div class="discussion">
563
-
564
- <p>Returns the value of attribute encoding.</p>
565
-
566
-
567
- </div>
568
- </div>
569
- <div class="tags">
570
-
571
-
572
- </div><table class="source_code">
573
- <tr>
574
- <td>
575
- <pre class="lines">
576
-
577
-
578
- 68
579
- 69
580
- 70</pre>
581
- </td>
582
- <td>
583
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 68</span>
584
-
585
- <span class='kw'>def</span> <span class='id identifier rubyid_encoding'>encoding</span>
586
- <span class='ivar'>@encoding</span>
587
- <span class='kw'>end</span></pre>
588
- </td>
589
- </tr>
590
- </table>
591
- </div>
592
-
593
-
594
- <span id=""></span>
595
- <div class="method_details ">
596
- <h3 class="signature " id="path-instance_method">
597
-
598
- #<strong>path</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
599
-
600
-
601
-
602
-
603
-
604
- </h3><div class="docstring">
605
- <div class="discussion">
606
-
607
- <p>Returns the value of attribute path.</p>
608
-
609
-
610
- </div>
611
- </div>
612
- <div class="tags">
613
-
614
-
615
- </div><table class="source_code">
616
- <tr>
617
- <td>
618
- <pre class="lines">
619
-
620
-
621
- 68
622
- 69
623
- 70</pre>
624
- </td>
625
- <td>
626
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 68</span>
627
-
628
- <span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
629
- <span class='ivar'>@path</span>
630
- <span class='kw'>end</span></pre>
631
- </td>
632
- </tr>
633
- </table>
634
- </div>
635
-
636
-
637
- <span id=""></span>
638
- <div class="method_details ">
639
- <h3 class="signature " id="quality-instance_method">
640
-
641
- #<strong>quality</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
642
-
643
-
644
-
645
-
646
-
647
- </h3><div class="docstring">
648
- <div class="discussion">
649
-
650
- <p>Returns the value of attribute quality.</p>
651
-
652
-
653
- </div>
654
- </div>
655
- <div class="tags">
656
-
657
-
658
- </div><table class="source_code">
659
- <tr>
660
- <td>
661
- <pre class="lines">
662
-
663
-
664
- 68
665
- 69
666
- 70</pre>
667
- </td>
668
- <td>
669
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 68</span>
670
-
671
- <span class='kw'>def</span> <span class='id identifier rubyid_quality'>quality</span>
672
- <span class='ivar'>@quality</span>
673
- <span class='kw'>end</span></pre>
674
- </td>
675
- </tr>
676
- </table>
677
- </div>
678
-
679
-
680
- <span id=""></span>
681
- <div class="method_details ">
682
- <h3 class="signature " id="type-instance_method">
683
-
684
- #<strong>type</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
685
-
686
-
687
-
688
-
689
-
690
- </h3><div class="docstring">
691
- <div class="discussion">
692
-
693
- <p>Returns the value of attribute type.</p>
694
-
695
-
696
- </div>
697
- </div>
698
- <div class="tags">
699
-
700
-
701
- </div><table class="source_code">
702
- <tr>
703
- <td>
704
- <pre class="lines">
705
-
706
-
707
- 68
708
- 69
709
- 70</pre>
710
- </td>
711
- <td>
712
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 68</span>
713
-
714
- <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
715
- <span class='ivar'>@type</span>
716
- <span class='kw'>end</span></pre>
717
- </td>
718
- </tr>
719
- </table>
720
- </div>
721
-
722
- </div>
723
-
724
-
725
- <div id="instance_method_details" class="method_details_list">
726
- <h2>Instance Method Details</h2>
727
-
728
-
729
- <div class="method_details first">
730
- <h3 class="signature first" id="full_page?-instance_method">
731
-
732
- #<strong>full_page?</strong> &#x21d2; <tt>Boolean</tt>
733
-
734
-
735
-
736
-
737
-
738
- </h3><div class="docstring">
739
- <div class="discussion">
740
-
741
-
742
- </div>
743
- </div>
744
- <div class="tags">
745
-
746
- <p class="tag_title">Returns:</p>
747
- <ul class="return">
748
-
749
- <li>
750
-
751
-
752
- <span class='type'>(<tt>Boolean</tt>)</span>
753
-
754
-
755
-
756
- </li>
757
-
758
- </ul>
759
-
760
- </div><table class="source_code">
761
- <tr>
762
- <td>
763
- <pre class="lines">
764
-
765
-
766
- 70
767
- 71
768
- 72</pre>
769
- </td>
770
- <td>
771
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 70</span>
772
-
773
- <span class='kw'>def</span> <span class='id identifier rubyid_full_page?'>full_page?</span>
774
- <span class='ivar'>@full_page</span>
775
- <span class='kw'>end</span></pre>
776
- </td>
777
- </tr>
778
- </table>
779
- </div>
780
-
781
- <div class="method_details ">
782
- <h3 class="signature " id="omit_background?-instance_method">
783
-
784
- #<strong>omit_background?</strong> &#x21d2; <tt>Boolean</tt>
785
-
786
-
787
-
788
-
789
-
790
- </h3><div class="docstring">
791
- <div class="discussion">
792
-
793
-
794
- </div>
795
- </div>
796
- <div class="tags">
797
-
798
- <p class="tag_title">Returns:</p>
799
- <ul class="return">
800
-
801
- <li>
802
-
803
-
804
- <span class='type'>(<tt>Boolean</tt>)</span>
805
-
806
-
807
-
808
- </li>
809
-
810
- </ul>
811
-
812
- </div><table class="source_code">
813
- <tr>
814
- <td>
815
- <pre class="lines">
816
-
817
-
818
- 74
819
- 75
820
- 76</pre>
821
- </td>
822
- <td>
823
- <pre class="code"><span class="info file"># File 'lib/puppeteer/page/screenshot_options.rb', line 74</span>
824
-
825
- <span class='kw'>def</span> <span class='id identifier rubyid_omit_background?'>omit_background?</span>
826
- <span class='ivar'>@omit_background</span>
827
- <span class='kw'>end</span></pre>
828
- </td>
829
- </tr>
830
- </table>
831
- </div>
832
-
833
- </div>
834
-
835
- </div>
836
-
837
- <div id="footer">
838
- Generated on Tue Jun 23 10:25:01 2020 by
839
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
840
- 0.9.24 (ruby-2.6.3).
841
- </div>
842
-
843
- </div>
844
- </body>
845
- </html>