puppeteer-ruby 0.0.3 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +30 -0
- data/.github/stale.yml +16 -0
- data/.rubocop.yml +4 -5
- data/README.md +4 -1
- data/docs/Puppeteer.html +2020 -0
- data/docs/Puppeteer/AsyncAwaitBehavior.html +105 -0
- data/docs/Puppeteer/Browser.html +2150 -0
- data/docs/Puppeteer/BrowserContext.html +809 -0
- data/docs/Puppeteer/BrowserFetcher.html +214 -0
- data/docs/Puppeteer/BrowserRunner.html +914 -0
- data/docs/Puppeteer/BrowserRunner/BrowserProcess.html +477 -0
- data/docs/Puppeteer/CDPSession.html +813 -0
- data/docs/Puppeteer/CDPSession/Error.html +124 -0
- data/docs/Puppeteer/ConcurrentRubyUtils.html +430 -0
- data/docs/Puppeteer/Connection.html +960 -0
- data/docs/Puppeteer/Connection/MessageCallback.html +434 -0
- data/docs/Puppeteer/Connection/ProtocolError.html +216 -0
- data/docs/Puppeteer/Connection/RequestDebugPrinter.html +217 -0
- data/docs/Puppeteer/Connection/ResponseDebugPrinter.html +244 -0
- data/docs/Puppeteer/ConsoleMessage.html +565 -0
- data/docs/Puppeteer/ConsoleMessage/Location.html +433 -0
- data/docs/Puppeteer/DOMWorld.html +2219 -0
- data/docs/Puppeteer/DOMWorld/DetachedError.html +124 -0
- data/docs/Puppeteer/DOMWorld/DocumentEvaluationError.html +124 -0
- data/docs/Puppeteer/DebugPrint.html +233 -0
- data/docs/Puppeteer/Device.html +470 -0
- data/docs/Puppeteer/Devices.html +139 -0
- data/docs/Puppeteer/ElementHandle.html +2224 -0
- data/docs/Puppeteer/ElementHandle/ElementNotFoundError.html +206 -0
- data/docs/Puppeteer/ElementHandle/ElementNotVisibleError.html +206 -0
- data/docs/Puppeteer/ElementHandle/Point.html +481 -0
- data/docs/Puppeteer/ElementHandle/ScrollIntoViewError.html +124 -0
- data/docs/Puppeteer/EmulationManager.html +454 -0
- data/docs/Puppeteer/EventCallbackable.html +433 -0
- data/docs/Puppeteer/EventCallbackable/EventListeners.html +435 -0
- data/docs/Puppeteer/ExecutionContext.html +998 -0
- data/docs/Puppeteer/ExecutionContext/EvaluationError.html +124 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptExpression.html +357 -0
- data/docs/Puppeteer/ExecutionContext/JavaScriptFunction.html +389 -0
- data/docs/Puppeteer/FileChooser.html +455 -0
- data/docs/Puppeteer/Frame.html +3677 -0
- data/docs/Puppeteer/FrameManager.html +2414 -0
- data/docs/Puppeteer/FrameManager/NavigationError.html +124 -0
- data/docs/Puppeteer/IfPresent.html +222 -0
- data/docs/Puppeteer/JSHandle.html +1352 -0
- data/docs/Puppeteer/Keyboard.html +1557 -0
- data/docs/Puppeteer/Keyboard/KeyDefinition.html +831 -0
- data/docs/Puppeteer/Keyboard/KeyDescription.html +603 -0
- data/docs/Puppeteer/Launcher.html +237 -0
- data/docs/Puppeteer/Launcher/Base.html +385 -0
- data/docs/Puppeteer/Launcher/Base/ExecutablePathNotFound.html +124 -0
- data/docs/Puppeteer/Launcher/BrowserOptions.html +441 -0
- data/docs/Puppeteer/Launcher/Chrome.html +669 -0
- data/docs/Puppeteer/Launcher/Chrome/DefaultArgs.html +382 -0
- data/docs/Puppeteer/Launcher/ChromeArgOptions.html +531 -0
- data/docs/Puppeteer/Launcher/LaunchOptions.html +893 -0
- data/docs/Puppeteer/LifecycleWatcher.html +834 -0
- data/docs/Puppeteer/LifecycleWatcher/ExpectedLifecycle.html +363 -0
- data/docs/Puppeteer/LifecycleWatcher/FrameDetachedError.html +206 -0
- data/docs/Puppeteer/LifecycleWatcher/TerminatedError.html +124 -0
- data/docs/Puppeteer/Mouse.html +1105 -0
- data/docs/Puppeteer/Mouse/Button.html +136 -0
- data/docs/Puppeteer/NetworkManager.html +901 -0
- data/docs/Puppeteer/NetworkManager/Credentials.html +385 -0
- data/docs/Puppeteer/Page.html +5970 -0
- data/docs/Puppeteer/Page/FileChooserTimeoutError.html +206 -0
- data/docs/Puppeteer/Page/ScreenshotOptions.html +845 -0
- data/docs/Puppeteer/Page/ScriptTag.html +555 -0
- data/docs/Puppeteer/Page/StyleTag.html +448 -0
- data/docs/Puppeteer/Page/TargetCrashedError.html +124 -0
- data/docs/Puppeteer/RemoteObject.html +1016 -0
- data/docs/Puppeteer/Target.html +1384 -0
- data/docs/Puppeteer/Target/InitializeFailure.html +124 -0
- data/docs/Puppeteer/Target/TargetInfo.html +729 -0
- data/docs/Puppeteer/TimeoutError.html +135 -0
- data/docs/Puppeteer/TimeoutSettings.html +496 -0
- data/docs/Puppeteer/TouchScreen.html +464 -0
- data/docs/Puppeteer/Viewport.html +757 -0
- data/docs/Puppeteer/WaitTask.html +637 -0
- data/docs/Puppeteer/WaitTask/TerminatedError.html +124 -0
- data/docs/Puppeteer/WaitTask/TimeoutError.html +206 -0
- data/docs/Puppeteer/WebSocket.html +673 -0
- data/docs/Puppeteer/WebSocket/DriverImpl.html +412 -0
- data/docs/Puppeteer/WebSocketTransport.html +600 -0
- data/docs/Puppeteer/WebSocktTransportError.html +124 -0
- data/docs/_index.html +809 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +123 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +123 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +3979 -0
- data/docs/top-level-namespace.html +126 -0
- data/lib/puppeteer.rb +16 -8
- data/lib/puppeteer/async_await_behavior.rb +6 -0
- data/lib/puppeteer/browser.rb +21 -1
- data/lib/puppeteer/browser_runner.rb +1 -1
- data/lib/puppeteer/cdp_session.rb +33 -11
- data/lib/puppeteer/connection.rb +1 -1
- data/lib/puppeteer/dom_world.rb +142 -121
- data/lib/puppeteer/element_handle.rb +223 -181
- data/lib/puppeteer/execution_context.rb +41 -17
- data/lib/puppeteer/file_chooser.rb +29 -0
- data/lib/puppeteer/frame.rb +23 -15
- data/lib/puppeteer/frame_manager.rb +7 -9
- data/lib/puppeteer/js_handle.rb +3 -3
- data/lib/puppeteer/keyboard.rb +1 -1
- data/lib/puppeteer/keyboard/us_keyboard_layout.rb +4 -4
- data/lib/puppeteer/launcher.rb +0 -1
- data/lib/puppeteer/launcher/chrome.rb +48 -2
- data/lib/puppeteer/lifecycle_watcher.rb +9 -4
- data/lib/puppeteer/mouse.rb +10 -7
- data/lib/puppeteer/page.rb +134 -70
- data/lib/puppeteer/remote_object.rb +11 -1
- data/lib/puppeteer/version.rb +1 -1
- data/lib/puppeteer/wait_task.rb +183 -1
- data/puppeteer-ruby.gemspec +4 -1
- metadata +143 -4
@@ -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
|
+
— 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> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span> » <span class='title'><span class='object_link'><a href="../ElementHandle.html" title="Puppeteer::ElementHandle (class)">ElementHandle</a></span></span>
|
41
|
+
»
|
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 Thu Jun 4 23:54:43 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
|
+
— 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> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Puppeteer.html" title="Puppeteer (class)">Puppeteer</a></span></span>
|
41
|
+
»
|
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> ⇒ Future<true|false> </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) ⇒ 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) ⇒ 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) ⇒ <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> ⇒ <tt>Future<true|false></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<true|false></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) ⇒ <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: 'landscapePrimary' } : { angle: 0, type: 'portraitPrimary' };
|
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'>'</span><span class='tstring_content'>Emulation.setDeviceMetricsOverride</span><span class='tstring_end'>'</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'>'</span><span class='tstring_content'>Emulation.setTouchEmulationEnabled</span><span class='tstring_end'>'</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 Thu Jun 4 23:54:43 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>
|