puppeteer-ruby 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +71 -0
  3. data/.github/stale.yml +16 -0
  4. data/.gitignore +19 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +302 -0
  7. data/.travis.yml +7 -0
  8. data/Dockerfile +6 -0
  9. data/Gemfile +6 -0
  10. data/README.md +54 -0
  11. data/Rakefile +1 -0
  12. data/bin/console +11 -0
  13. data/bin/setup +8 -0
  14. data/docker-compose.yml +15 -0
  15. data/docs/Puppeteer.html +2020 -0
  16. data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
  17. data/docs/Puppeteer/Browser.html +2148 -0
  18. data/docs/Puppeteer/BrowserContext.html +809 -0
  19. data/docs/Puppeteer/BrowserFetcher.html +214 -0
  20. data/docs/Puppeteer/BrowserRunner.html +914 -0
  21. data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
  22. data/docs/Puppeteer/CDPSession.html +813 -0
  23. data/docs/Puppeteer/CDPSession/Error.html +124 -0
  24. data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
  25. data/docs/Puppeteer/Connection.html +960 -0
  26. data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
  27. data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
  28. data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
  29. data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
  30. data/docs/Puppeteer/ConsoleMessage.html +565 -0
  31. data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
  32. data/docs/Puppeteer/DOMWorld.html +2219 -0
  33. data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
  34. data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
  35. data/docs/Puppeteer/DebugPrint.html +233 -0
  36. data/docs/Puppeteer/Device.html +470 -0
  37. data/docs/Puppeteer/Devices.html +139 -0
  38. data/docs/Puppeteer/ElementHandle.html +2542 -0
  39. data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
  40. data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
  41. data/docs/Puppeteer/ElementHandle/Point.html +492 -0
  42. data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
  43. data/docs/Puppeteer/EmulationManager.html +454 -0
  44. data/docs/Puppeteer/EventCallbackable.html +433 -0
  45. data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
  46. data/docs/Puppeteer/ExecutionContext.html +998 -0
  47. data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
  48. data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
  49. data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
  50. data/docs/Puppeteer/FileChooser.html +455 -0
  51. data/docs/Puppeteer/Frame.html +3677 -0
  52. data/docs/Puppeteer/FrameManager.html +2410 -0
  53. data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
  54. data/docs/Puppeteer/IfPresent.html +222 -0
  55. data/docs/Puppeteer/JSHandle.html +1352 -0
  56. data/docs/Puppeteer/Keyboard.html +1557 -0
  57. data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
  58. data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
  59. data/docs/Puppeteer/Launcher.html +237 -0
  60. data/docs/Puppeteer/Launcher/Base.html +385 -0
  61. data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
  62. data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
  63. data/docs/Puppeteer/Launcher/Chrome.html +669 -0
  64. data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
  65. data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
  66. data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
  67. data/docs/Puppeteer/LifecycleWatcher.html +834 -0
  68. data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
  69. data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
  70. data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
  71. data/docs/Puppeteer/Mouse.html +1105 -0
  72. data/docs/Puppeteer/Mouse/Button.html +136 -0
  73. data/docs/Puppeteer/NetworkManager.html +901 -0
  74. data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
  75. data/docs/Puppeteer/Page.html +5970 -0
  76. data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -0
  77. data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
  78. data/docs/Puppeteer/Page/ScriptTag.html +555 -0
  79. data/docs/Puppeteer/Page/StyleTag.html +448 -0
  80. data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
  81. data/docs/Puppeteer/RemoteObject.html +1087 -0
  82. data/docs/Puppeteer/Target.html +1336 -0
  83. data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
  84. data/docs/Puppeteer/Target/TargetInfo.html +729 -0
  85. data/docs/Puppeteer/TimeoutError.html +135 -0
  86. data/docs/Puppeteer/TimeoutSettings.html +496 -0
  87. data/docs/Puppeteer/TouchScreen.html +464 -0
  88. data/docs/Puppeteer/Viewport.html +837 -0
  89. data/docs/Puppeteer/WaitTask.html +637 -0
  90. data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
  91. data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -0
  92. data/docs/Puppeteer/WebSocket.html +673 -0
  93. data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
  94. data/docs/Puppeteer/WebSocketTransport.html +600 -0
  95. data/docs/Puppeteer/WebSocktTransportError.html +124 -0
  96. data/docs/_index.html +823 -0
  97. data/docs/class_list.html +51 -0
  98. data/docs/css/common.css +1 -0
  99. data/docs/css/full_list.css +58 -0
  100. data/docs/css/style.css +496 -0
  101. data/docs/file.README.html +123 -0
  102. data/docs/file_list.html +56 -0
  103. data/docs/frames.html +17 -0
  104. data/docs/index.html +123 -0
  105. data/docs/js/app.js +314 -0
  106. data/docs/js/full_list.js +216 -0
  107. data/docs/js/jquery.js +4 -0
  108. data/docs/method_list.html +4075 -0
  109. data/docs/top-level-namespace.html +126 -0
  110. data/lib/puppeteer.rb +200 -0
  111. data/lib/puppeteer/async_await_behavior.rb +38 -0
  112. data/lib/puppeteer/browser.rb +259 -0
  113. data/lib/puppeteer/browser_context.rb +90 -0
  114. data/lib/puppeteer/browser_fetcher.rb +6 -0
  115. data/lib/puppeteer/browser_runner.rb +161 -0
  116. data/lib/puppeteer/cdp_session.rb +100 -0
  117. data/lib/puppeteer/concurrent_ruby_utils.rb +37 -0
  118. data/lib/puppeteer/connection.rb +254 -0
  119. data/lib/puppeteer/console_message.rb +24 -0
  120. data/lib/puppeteer/debug_print.rb +20 -0
  121. data/lib/puppeteer/device.rb +12 -0
  122. data/lib/puppeteer/devices.rb +885 -0
  123. data/lib/puppeteer/dom_world.rb +484 -0
  124. data/lib/puppeteer/element_handle.rb +433 -0
  125. data/lib/puppeteer/element_handle/bounding_box.rb +12 -0
  126. data/lib/puppeteer/element_handle/box_model.rb +19 -0
  127. data/lib/puppeteer/element_handle/point.rb +26 -0
  128. data/lib/puppeteer/emulation_manager.rb +46 -0
  129. data/lib/puppeteer/errors.rb +2 -0
  130. data/lib/puppeteer/event_callbackable.rb +88 -0
  131. data/lib/puppeteer/execution_context.rb +254 -0
  132. data/lib/puppeteer/file_chooser.rb +29 -0
  133. data/lib/puppeteer/frame.rb +286 -0
  134. data/lib/puppeteer/frame_manager.rb +378 -0
  135. data/lib/puppeteer/if_present.rb +18 -0
  136. data/lib/puppeteer/js_handle.rb +142 -0
  137. data/lib/puppeteer/keyboard.rb +183 -0
  138. data/lib/puppeteer/keyboard/key_description.rb +19 -0
  139. data/lib/puppeteer/keyboard/us_keyboard_layout.rb +283 -0
  140. data/lib/puppeteer/launcher.rb +25 -0
  141. data/lib/puppeteer/launcher/base.rb +48 -0
  142. data/lib/puppeteer/launcher/browser_options.rb +41 -0
  143. data/lib/puppeteer/launcher/chrome.rb +211 -0
  144. data/lib/puppeteer/launcher/chrome_arg_options.rb +49 -0
  145. data/lib/puppeteer/launcher/launch_options.rb +68 -0
  146. data/lib/puppeteer/lifecycle_watcher.rb +171 -0
  147. data/lib/puppeteer/mouse.rb +123 -0
  148. data/lib/puppeteer/network_manager.rb +122 -0
  149. data/lib/puppeteer/page.rb +1065 -0
  150. data/lib/puppeteer/page/screenshot_options.rb +78 -0
  151. data/lib/puppeteer/remote_object.rb +143 -0
  152. data/lib/puppeteer/target.rb +150 -0
  153. data/lib/puppeteer/timeout_settings.rb +15 -0
  154. data/lib/puppeteer/touch_screen.rb +43 -0
  155. data/lib/puppeteer/version.rb +3 -0
  156. data/lib/puppeteer/viewport.rb +54 -0
  157. data/lib/puppeteer/wait_task.rb +188 -0
  158. data/lib/puppeteer/web_socket.rb +122 -0
  159. data/lib/puppeteer/web_socket_transport.rb +49 -0
  160. data/puppeteer-ruby.gemspec +32 -0
  161. metadata +355 -0
@@ -0,0 +1,124 @@
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::ElementHandle::ScrollIntoViewError
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::ElementHandle::ScrollIntoViewError";
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="../ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span></span>
41
+ &raquo;
42
+ <span class="title">ScrollIntoViewError</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::ElementHandle::ScrollIntoViewError
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::ElementHandle::ScrollIntoViewError</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/element_handle.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 Fri Jun 12 12:38:35 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>
@@ -0,0 +1,454 @@
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::EmulationManager
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::EmulationManager";
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 (E)</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">EmulationManager</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::EmulationManager
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::EmulationManager</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/emulation_manager.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Instance Method Summary
112
+ <small><a href="#" class="summary_toggle">collapse</a></small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#async_emulate_viewport-instance_method" title="#async_emulate_viewport (instance method)">#<strong>async_emulate_viewport</strong> &#x21d2; Future&lt;true|false&gt; </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'></div></span>
135
+
136
+ </li>
137
+
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#emulate_viewport-instance_method" title="#emulate_viewport (instance method)">#<strong>emulate_viewport</strong>(viewport) &#x21d2; true|false </a>
143
+
144
+
145
+
146
+ </span>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'></div></span>
157
+
158
+ </li>
159
+
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(client) &#x21d2; EmulationManager </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+ <span class="note title constructor">constructor</span>
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>A new instance of EmulationManager.</p>
182
+ </div></span>
183
+
184
+ </li>
185
+
186
+
187
+ </ul>
188
+
189
+
190
+ <div id="constructor_details" class="method_details_list">
191
+ <h2>Constructor Details</h2>
192
+
193
+ <div class="method_details first">
194
+ <h3 class="signature first" id="initialize-instance_method">
195
+
196
+ #<strong>initialize</strong>(client) &#x21d2; <tt><span class='object_link'><a href="" title="Puppeteer::EmulationManager (class)">EmulationManager</a></span></tt>
197
+
198
+
199
+
200
+
201
+
202
+ </h3><div class="docstring">
203
+ <div class="discussion">
204
+
205
+ <p>Returns a new instance of EmulationManager.</p>
206
+
207
+
208
+ </div>
209
+ </div>
210
+ <div class="tags">
211
+ <p class="tag_title">Parameters:</p>
212
+ <ul class="param">
213
+
214
+ <li>
215
+
216
+ <span class='name'>client</span>
217
+
218
+
219
+ <span class='type'>(<tt>!<span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span>.<span class='object_link'><a href="CDPSession.html" title="Puppeteer::CDPSession (class)">CDPSession</a></span></tt>)</span>
220
+
221
+
222
+
223
+ </li>
224
+
225
+ </ul>
226
+
227
+
228
+ </div><table class="source_code">
229
+ <tr>
230
+ <td>
231
+ <pre class="lines">
232
+
233
+
234
+ 5
235
+ 6
236
+ 7
237
+ 8
238
+ 9</pre>
239
+ </td>
240
+ <td>
241
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/emulation_manager.rb', line 5</span>
242
+
243
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_client'>client</span><span class='rparen'>)</span>
244
+ <span class='ivar'>@client</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span>
245
+ <span class='ivar'>@emulating_mobile</span> <span class='op'>=</span> <span class='kw'>false</span>
246
+ <span class='ivar'>@has_touch</span> <span class='op'>=</span> <span class='kw'>false</span>
247
+ <span class='kw'>end</span></pre>
248
+ </td>
249
+ </tr>
250
+ </table>
251
+ </div>
252
+
253
+ </div>
254
+
255
+
256
+ <div id="instance_method_details" class="method_details_list">
257
+ <h2>Instance Method Details</h2>
258
+
259
+
260
+ <div class="method_details first">
261
+ <h3 class="signature first" id="async_emulate_viewport-instance_method">
262
+
263
+ #<strong>async_emulate_viewport</strong> &#x21d2; <tt>Future&lt;true|false&gt;</tt>
264
+
265
+
266
+
267
+
268
+
269
+ </h3><div class="docstring">
270
+ <div class="discussion">
271
+
272
+
273
+ </div>
274
+ </div>
275
+ <div class="tags">
276
+ <p class="tag_title">Parameters:</p>
277
+ <ul class="param">
278
+
279
+ <li>
280
+
281
+ <span class='name'>viewport</span>
282
+
283
+
284
+ <span class='type'>(<tt><span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Puppeteer::Viewport</a></span></tt>)</span>
285
+
286
+
287
+
288
+ </li>
289
+
290
+ </ul>
291
+
292
+ <p class="tag_title">Returns:</p>
293
+ <ul class="return">
294
+
295
+ <li>
296
+
297
+
298
+ <span class='type'>(<tt>Future&lt;true|false&gt;</tt>)</span>
299
+
300
+
301
+
302
+ </li>
303
+
304
+ </ul>
305
+
306
+ </div><table class="source_code">
307
+ <tr>
308
+ <td>
309
+ <pre class="lines">
310
+
311
+
312
+ 43
313
+ 44
314
+ 45</pre>
315
+ </td>
316
+ <td>
317
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/emulation_manager.rb', line 43</span>
318
+
319
+ <span class='id identifier rubyid_async'>async</span> <span class='kw'>def</span> <span class='id identifier rubyid_async_emulate_viewport'>async_emulate_viewport</span><span class='lparen'>(</span><span class='id identifier rubyid_viewport'>viewport</span><span class='rparen'>)</span>
320
+ <span class='id identifier rubyid_emulate_viewport'>emulate_viewport</span><span class='lparen'>(</span><span class='id identifier rubyid_viewport'>viewport</span><span class='rparen'>)</span>
321
+ <span class='kw'>end</span></pre>
322
+ </td>
323
+ </tr>
324
+ </table>
325
+ </div>
326
+
327
+ <div class="method_details ">
328
+ <h3 class="signature " id="emulate_viewport-instance_method">
329
+
330
+ #<strong>emulate_viewport</strong>(viewport) &#x21d2; <tt>true|false</tt>
331
+
332
+
333
+
334
+
335
+
336
+ </h3><div class="docstring">
337
+ <div class="discussion">
338
+
339
+
340
+ </div>
341
+ </div>
342
+ <div class="tags">
343
+ <p class="tag_title">Parameters:</p>
344
+ <ul class="param">
345
+
346
+ <li>
347
+
348
+ <span class='name'>viewport</span>
349
+
350
+
351
+ <span class='type'>(<tt><span class='object_link'><a href="Viewport.html" title="Puppeteer::Viewport (class)">Puppeteer::Viewport</a></span></tt>)</span>
352
+
353
+
354
+
355
+ </li>
356
+
357
+ </ul>
358
+
359
+ <p class="tag_title">Returns:</p>
360
+ <ul class="return">
361
+
362
+ <li>
363
+
364
+
365
+ <span class='type'>(<tt>true|false</tt>)</span>
366
+
367
+
368
+
369
+ </li>
370
+
371
+ </ul>
372
+
373
+ </div><table class="source_code">
374
+ <tr>
375
+ <td>
376
+ <pre class="lines">
377
+
378
+
379
+ 13
380
+ 14
381
+ 15
382
+ 16
383
+ 17
384
+ 18
385
+ 19
386
+ 20
387
+ 21
388
+ 22
389
+ 23
390
+ 24
391
+ 25
392
+ 26
393
+ 27
394
+ 28
395
+ 29
396
+ 30
397
+ 31
398
+ 32
399
+ 33
400
+ 34
401
+ 35
402
+ 36
403
+ 37
404
+ 38
405
+ 39</pre>
406
+ </td>
407
+ <td>
408
+ <pre class="code"><span class="info file"># File 'lib/puppeteer/emulation_manager.rb', line 13</span>
409
+
410
+ <span class='kw'>def</span> <span class='id identifier rubyid_emulate_viewport'>emulate_viewport</span><span class='lparen'>(</span><span class='id identifier rubyid_viewport'>viewport</span><span class='rparen'>)</span>
411
+ <span class='id identifier rubyid_mobile'>mobile</span> <span class='op'>=</span> <span class='id identifier rubyid_viewport'>viewport</span><span class='period'>.</span><span class='id identifier rubyid_mobile?'>mobile?</span>
412
+ <span class='id identifier rubyid_width'>width</span> <span class='op'>=</span> <span class='id identifier rubyid_viewport'>viewport</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span>
413
+ <span class='id identifier rubyid_height'>height</span> <span class='op'>=</span> <span class='id identifier rubyid_viewport'>viewport</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span>
414
+ <span class='id identifier rubyid_device_scale_factor'>device_scale_factor</span> <span class='op'>=</span> <span class='id identifier rubyid_viewport'>viewport</span><span class='period'>.</span><span class='id identifier rubyid_device_scale_factor'>device_scale_factor</span>
415
+ <span class='comment'># /** @type {Protocol.Emulation.ScreenOrientation} */
416
+ </span> <span class='comment'># const screenOrientation = viewport.isLandscape ? { angle: 90, type: &#39;landscapePrimary&#39; } : { angle: 0, type: &#39;portraitPrimary&#39; };
417
+ </span> <span class='id identifier rubyid_has_touch'>has_touch</span> <span class='op'>=</span> <span class='id identifier rubyid_viewport'>viewport</span><span class='period'>.</span><span class='id identifier rubyid_has_touch?'>has_touch?</span>
418
+
419
+ <span class='id identifier rubyid_await_all'><span class='object_link'><a href="ConcurrentRubyUtils.html#await_all-instance_method" title="Puppeteer::ConcurrentRubyUtils#await_all (method)">await_all</a></span></span><span class='lparen'>(</span>
420
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_async_send_message'>async_send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Emulation.setDeviceMetricsOverride</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
421
+ <span class='label'>mobile:</span> <span class='id identifier rubyid_mobile'>mobile</span><span class='comma'>,</span>
422
+ <span class='label'>width:</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span>
423
+ <span class='label'>height:</span> <span class='id identifier rubyid_height'>height</span><span class='comma'>,</span>
424
+ <span class='label'>deviceScaleFactor:</span> <span class='id identifier rubyid_device_scale_factor'>device_scale_factor</span><span class='comma'>,</span>
425
+ <span class='comment'># screenOrientation: screen_orientation,
426
+ </span> <span class='rparen'>)</span><span class='comma'>,</span>
427
+ <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_async_send_message'>async_send_message</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Emulation.setTouchEmulationEnabled</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
428
+ <span class='label'>enabled:</span> <span class='id identifier rubyid_has_touch'>has_touch</span><span class='comma'>,</span>
429
+ <span class='rparen'>)</span><span class='comma'>,</span>
430
+ <span class='rparen'>)</span>
431
+
432
+ <span class='id identifier rubyid_reload_needed'>reload_needed</span> <span class='op'>=</span> <span class='ivar'>@emulating_mobile</span> <span class='op'>!=</span> <span class='id identifier rubyid_mobile'>mobile</span> <span class='op'>||</span> <span class='ivar'>@hasTouch</span> <span class='op'>!=</span> <span class='id identifier rubyid_has_touch'>has_touch</span>
433
+ <span class='ivar'>@emulating_mobile</span> <span class='op'>=</span> <span class='id identifier rubyid_mobile'>mobile</span>
434
+ <span class='ivar'>@has_touch</span> <span class='op'>=</span> <span class='id identifier rubyid_has_touch'>has_touch</span>
435
+ <span class='id identifier rubyid_reload_needed'>reload_needed</span>
436
+ <span class='kw'>end</span></pre>
437
+ </td>
438
+ </tr>
439
+ </table>
440
+ </div>
441
+
442
+ </div>
443
+
444
+ </div>
445
+
446
+ <div id="footer">
447
+ Generated on Fri Jun 12 12:38:35 2020 by
448
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
449
+ 0.9.24 (ruby-2.6.3).
450
+ </div>
451
+
452
+ </div>
453
+ </body>
454
+ </html>